format_exception
(function from pyomo.common.errors
)
- pyomo.common.errors.format_exception(msg, prolog=None, epilog=None, exception=None, width=76)[source]
Generate a formatted exception message
This returns a formatted exception message, line wrapped for display on the console and with optional prolog and epilog messages.
- Parameters:
msg (str) – The raw exception message
prolog (str, optional) – A message to output before the exception message,
msg
. If this message is long enough to line wrap, themsg
will be indented a level below theprolog
message.epilog (str, optional) – A message to output after the exception message,
msg
. If provided, themsg
will be indented a level below theprolog
/epilog
messages.exception (Exception, optional) – The raw exception being raised (used to improve initial line wrapping).
width (int, optional) – The line length to wrap the exception message to.
- Return type: