GeoLeaf Core API - v3.0.0
    Preparing search index...

    Function getErrorCode

    • Reads the machine code off any value, without assuming it is an error.

      Any object carrying a code property yields it — including native DOMException and Node-style errors, which is deliberate. Anything else yields "UNKNOWN_ERROR", so the result is always a usable string.

      Parameters

      • error: unknown

        The value to inspect.

      Returns string

      The code property, or "UNKNOWN_ERROR".

      const code = GeoLeaf.Errors.getErrorCode(error);
      // 'VALIDATION_ERROR' | 'CONFIG_ERROR' | ... | 'UNKNOWN_ERROR'