Explorer

definy.rpc-error-status

description
(en) The HTTP status of a Connect error code (docs/connect-rpc.md)
type
Fn(code: String) -> Number
expression
fn(code$0) =>
  match $0 {
    "invalid_argument" =>
      400,
    "unauthenticated" =>
      401,
    "failed_precondition" =>
      400,
    "permission_denied" =>
      403,
    "not_found" =>
      404,
    "unimplemented" =>
      404,
    "resource_exhausted" =>
      429,
    _ =>
      500
  }
visibility
public
definy.rpc-error-status (project definy, branch main, snapshot l0VFjJZP174d8CbZWFoujAGTYjgsQu4uTq5uWCZaXgo)
id: t3pV3pduH4xU-87f3bOvTcxq5LaPnaXgDt01KF1Di74
content hash: FI3C9pXCtrv2jdR_f0tlXs-akjL41G6ZvvghzmdoVQE