1 # GNU MediaGoblin -- federated, autonomous media hosting
2 # Copyright (C) 2011 MediaGoblin contributors. See AUTHORS.
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 paste
.exceptions
.errormiddleware
import make_error_middleware
19 MGOBLIN_ERROR_MESSAGE
= """\
20 <div style="text-align:center;font-family: monospace">
21 <h1>YEOWCH... that's an error!</h1>
23 .-------------------------.
38 '-------------------------'
40 <p>Something bad happened, and things broke.</p>
41 <p>If this is not your website, you may want to alert the owner.</p>
44 Powered... er broken... by
45 <a href="http://www.mediagoblin.org">MediaGoblin</a>,
46 a <a href="http://www.gnu.org">GNU Project</a>.
51 def mgoblin_error_middleware(app
, global_conf
, **kw
):
53 MediaGoblin wrapped error middleware.
55 This is really just wrapping the error middleware from Paste.
56 It should take all of Paste's default options, so see:
57 http://pythonpaste.org/modules/exceptions.html
59 kw
['error_message'] = MGOBLIN_ERROR_MESSAGE
60 return make_error_middleware(app
, global_conf
, **kw
)