1 # GNU MediaGoblin -- federated, autonomous media hosting
2 # Copyright (C) 2011 Free Software Foundation, Inc
4 # This program is free software: you can redistribute it and/or modify
5 # it under the terms of the GNU Affero General Public License as published by
6 # the Free Software Foundation, either version 3 of the License, or
7 # (at your option) any later version.
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU Affero General Public License for more details.
14 # You should have received a copy of the GNU Affero General Public License
15 # along with this program. If not, see <http://www.gnu.org/licenses/>.
17 from mediagoblin
.util
import lazy_pass_to_ugettext
as _
19 class BaseProcessingFail(Exception):
21 Base exception that all other processing failure messages should
24 You shouldn't call this itself; instead you should subclass it
25 and provid the exception_path and general_message applicable to
31 def exception_path(self
):
33 self
.__class
__.__module
__, self
.__class
__.__name
__)
35 def __init__(self
, **metadata
):
36 self
.metadata
= metadata
or {}
39 class BadMediaFail(BaseProcessingFail
):
41 Error that should be raised when an inappropriate file was given
42 for the media type specified.
44 general_message
= _(u
'Invalid file given for media type.')