Axinom Mosaic Libraries
    Preparing search index...
    • A factory function to create a getter function to map a thrown error to a more user-friendly error.

      • If thrown error is `MosaicError - it is re-returned as is.
      • If thrown error is not an instance of an Error class - MosaicError with UnhandledError code and message is returned.
      • If passed mapper function returns an info object (and not undefined) - MosaicError is returned, constructed from original error and info from passed mapper.
      • If passed mapper returns a falsy value - MosaicError with UnhandledError code and message is returned.

      Type Parameters

      • TCustomInfo = any

      Parameters

      Returns (error: unknown, context?: TCustomInfo) => MosaicError