Throw custom exception

    0

    0

    Michael Born

    exception-handling

    The code throws a MyCustomException exception with a custom message and a serialized (JSON) struct of additional (custom) info.

    Shortcut: throw

    Filename pattern: *.cfc,*.cfm

    throw(
      type         = "MyCustomException",
      message      = "You forgot to flip the joplinator to the 'sechenburger' setting before running .start().",
      extendedInfo = serializeJSON( customInfo )
    );
    Codiga Logo
    Codiga Hub
    • Rulesets
    • Playground
    • Snippets
    • Cookbooks
    soc-2 icon

    We are SOC-2 Compliance Certified

    G2 high performer medal

    Codiga – All rights reserved 2022.