def to_string

bendonnect-rpc@0.1.0.0 · src/code.bend:23

import bendonnect-rpc@0.1.0.0/src/code.bend as Code
import Base

23# The wire name, as it appears in an Error's "code" property.
24def to_string(c: Code) -> String:
25  match c:
26    case Canceled{}:
27      "canceled"
28    case Unknown{}:
29      "unknown"
30    case InvalidArgument{}:
31      "invalid_argument"
32    case DeadlineExceeded{}:
33      "deadline_exceeded"
34    case NotFound{}:
35      "not_found"
36    case AlreadyExists{}:
37      "already_exists"
38    case PermissionDenied{}:
39      "permission_denied"
40    case ResourceExhausted{}:
41      "resource_exhausted"
42    case FailedPrecondition{}:
43      "failed_precondition"
44    case Aborted{}:
45      "aborted"
46    case OutOfRange{}:
47      "out_of_range"
48    case Unimplemented{}:
49      "unimplemented"
50    case Internal{}:
51      "internal"
52    case Unavailable{}:
53      "unavailable"
54    case DataLoss{}:
55      "data_loss"
56    case Unauthenticated{}:
57      "unauthenticated"

Uses (2)

Used by (2)