{
  "name": "MException members documented by MathWorks for use in MATLAB catch blocks",
  "description": "Properties and methods of the MATLAB MException class that a catch block can use, with member kind and the documented role of each. Compiled from the MathWorks MException and try/catch reference pages.",
  "page": "https://casrai.org/guides/try-catch-in-matlab",
  "publisher": "CASRAI",
  "license": "https://creativecommons.org/licenses/by/4.0/",
  "dateModified": "2026-11-16T22:02:28Z",
  "temporalCoverage": null,
  "spatialCoverage": null,
  "columns": [
    {
      "name": "Member",
      "unit": "",
      "description": ""
    },
    {
      "name": "Kind",
      "unit": "",
      "description": ""
    },
    {
      "name": "Documented role",
      "unit": "",
      "description": ""
    }
  ],
  "rows": [
    {
      "Member": "identifier",
      "Kind": "Property (read-only)",
      "Documented role": "Error identifier in component:mnemonic form, used to dispatch in a switch"
    },
    {
      "Member": "message",
      "Kind": "Property (read-only)",
      "Documented role": "Error message text"
    },
    {
      "Member": "stack",
      "Kind": "Property (read-only)",
      "Documented role": "N-by-1 structure with file, name and line, generated when the exception is thrown"
    },
    {
      "Member": "cause",
      "Kind": "Property (read-only)",
      "Documented role": "Cell array of MException objects recording underlying causes"
    },
    {
      "Member": "Correction",
      "Kind": "Property (read-only)",
      "Documented role": "Suggested corrections attached to the exception"
    },
    {
      "Member": "throw",
      "Kind": "Method",
      "Documented role": "Throws the exception"
    },
    {
      "Member": "rethrow",
      "Kind": "Method",
      "Documented role": "Rethrows a caught exception, used for errors the handler does not deal with"
    },
    {
      "Member": "throwAsCaller",
      "Kind": "Method",
      "Documented role": "Throws the exception as though raised by the caller"
    },
    {
      "Member": "getReport",
      "Kind": "Method",
      "Documented role": "Returns the error message"
    },
    {
      "Member": "addCause",
      "Kind": "Method",
      "Documented role": "Adds an exception to the cause list"
    },
    {
      "Member": "addCorrection",
      "Kind": "Method",
      "Documented role": "Attaches a correction to the exception"
    },
    {
      "Member": "MException.last",
      "Kind": "Static method",
      "Documented role": "Returns the last uncaught exception"
    }
  ],
  "sources": [
    {
      "title": "MathWorks: MException",
      "url": "https://www.mathworks.com/help/matlab/ref/mexception.html",
      "accessed": "2026-11-12"
    },
    {
      "title": "MathWorks: try, catch",
      "url": "https://www.mathworks.com/help/matlab/ref/try.html",
      "accessed": "2026-11-12"
    }
  ]
}