Skip to content
Myr

Removed 500 not being registerable for blueprints

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Phil Schaf · committed by Phil Schaf · parent aa4700c · Browse files · 1 file+1 added−15 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+1 added−15 removed

  • other:+1 added−15 removed

1 file+1 added−15 removed

modified:flask/app.py+1 added-15 removed
1209 unmodified lines
1210 'Tried to register a handler for an exception instance {0!r}. '1211 'Handlers can only be registered for exception classes or HTTP error codes.'1212 .format(code_or_exception))1213 1214 code = code_or_exception1215 is_code = isinstance(code_or_exception, integer_types)1216 if not is_code:1217 if issubclass(code_or_exception, HTTPException):1218 code = code_or_exception.code1219 else:1220 code = None1221 1214 handlers = self.error_handler_spec.setdefault(key, ExceptionHandlerDict(self, key))1215 1224 if is_code:1225 # TODO: why is this?1226 assert code != 500 or key is None, \1227 'It is currently not possible to register a 500 internal ' \1228 'server error on a per-blueprint level.'1229 1216 handlers[code_or_exception] = f12171218 @setupmethod1219 def template_filter(self, name=None):
316 unmodified lines
1536 """1537 exc_type, exc_value, tb = sys.exc_info()15381539 got_request_exception.send(self, exception=e)1554 handler = self.error_handler_spec[None].get(500)1540 handler = self._find_error_handler(InternalServerError())15411542 if self.propagate_exceptions:1543 # if we want to repropagate the exception, we can attempt to1544 # raise it with the whole traceback in case we can do that
449 unmodified lines