Function getErrorMessage

  • Internal

    Attempt to get an error message from a value.

    • If the value is an error, the error's message is returned.
    • If the value is an object with a message property, the value of that property is returned.
    • If the value is a string, the value is returned.
    • Otherwise, "Unknown error." is returned.

    Returns

    The error message.

    Parameters

    • Optional error: unknown

      The value to get an error message from.

    Returns string