• Type-safe function to get the error message from an error thrown in a try-catch block

    Parameters

    • err: any

      The error as string or Error object

    • Optional options: GetErrorMessageOptions

      Options that determine how the error message is returned; defaults can be changed by modifying the defaults property.

    Returns any

    String version of the err