226
228
# If this is a non-4xx IVLEError, get the message and httpcode and
227
229
# make the error message a bit nicer (but still include the
230
codename, msg = req.get_http_codename(httpcode)
231
except AttributeError:
232
codename, msg = None, None
233
# Override the default message with the supplied one,
235
if hasattr(exc_value, 'message') and exc_value.message is not None:
236
msg = exc_value.message
237
# Prepend the exception type
238
if exc_type != util.IVLEError:
239
msg = exc_type.__name__ + ": " + msg
241
tb = ''.join(traceback.format_exception(exc_type, exc_value,
231
# We also need to special-case IVLEJailError, as we can get another
232
# almost-exception out of it.
234
codename, msg = None, None
236
if exc_type is util.IVLEJailError:
237
msg = exc_value.type_str + ": " + exc_value.message
238
tb = 'Exception information extracted from IVLEJailError:\n'
239
tb += urllib.unquote(exc_value.info)
242
codename, msg = req.get_http_codename(httpcode)
243
except AttributeError:
245
# Override the default message with the supplied one,
247
if hasattr(exc_value, 'message') and exc_value.message is not None:
248
msg = exc_value.message
249
# Prepend the exception type
250
if exc_type != util.IVLEError:
251
msg = exc_type.__name__ + ": " + msg
253
tb = ''.join(traceback.format_exception(exc_type, exc_value,
244
256
req.write("""<html>
245
257
<head><title>IVLE Internal Server Error</title></head>