Crypto Server
    Preparing search index...

    Function classifyCryptoError

    • Classify a crypto operation error as client (4xx) or server (5xx), and send it as an RFC 9457 problem. A crypto-lib CryptoError is classified by its code (crypto-lib's isCallerErrorCode), which the problem carries as code; a RangeError from @noble/* (input of the wrong length) is a 400; anything else is a 500.

      Parameters

      • error: unknown
      • request: { log: { error: (err: unknown, msg: string) => void } }
      • reply: FastifyReply
      • operation: string

      Returns FastifyReply

      classifyCryptoError(error, request, reply, "Encryption");