Skip to content

getReport

Format an exception object as a string.

msg = getReport(exception)
msg = getReport(exception, type)
msg = getReport(exception, type, 'hyperlinks', val)

Returns a formatted string description of the exception. type controls verbosity — 'simple' (default, just the message) or 'extended' (full stack trace). The hyperlinks option ('on' / 'off' / 'default') controls whether file/line references are formatted as clickable links in IDE consoles.

try; foo; catch ME;
disp(getReport(ME, 'extended'));
end
  • MException — Construct an exception object.
  • lasterror — Information about the last error encountered.