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, themsgwill be indented a level below theprologmessage.epilog (str, optional) – A message to output after the exception message,
msg. If provided, themsgwill be indented a level below theprolog/epilogmessages.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: