src/code.bend checks
raw source on the hub · import bendonnect-rpc@0.1.0.0/src/code.bend as Code
Connect error codes (https://connectrpc.com/docs/protocol/#error-codes). Only these sixteen codes are valid: Connect has no user-defined codes.
1 import
import Base
Types
type Code source · line 5 · raw
Data
CanceledCode
UnknownCode
InvalidArgumentCode
DeadlineExceededCode
NotFoundCode
AlreadyExistsCode
PermissionDeniedCode
ResourceExhaustedCode
FailedPreconditionCode
AbortedCode
OutOfRangeCode
UnimplementedCode
InternalCode
DataLossCode
UnauthenticatedCode
type Row source · line 121 · raw
Data
One row of the spec's HTTP-to-code table.
Row@status:U32 -> @code:Code -> Row
Definitions
def to_string source · line 24 · raw
@c:Code -> String
The wire name, as it appears in an Error's "code" property.
def to_http source · line 60 · raw
@c:Code -> U32
The HTTP status a unary error response carries.
def all source · line 96 · raw
List<&2, Code>
All codes, in the order of the spec's table.
def from_string.pick source · line 102 · raw
@hit:Bool -> @c:Code -> @rest:(@_:Unit -> Maybe<&2, Code>) -> Maybe<&2, Code>
def from_string.go source · line 109 · raw
@cs:List<&2, Code> -> @+s:String -> Maybe<&2, Code>
def from_string source · line 117 · raw
@+s:String -> Maybe<&2, Code>
Parses a wire name; None for anything that is not one of the sixteen codes.
def from_http.pick source · line 124 · raw
@hit:Bool -> @c:Code -> @rest:(@_:Unit -> Code) -> Code
def from_http.go source · line 131 · raw
@table:List<&2, Row> -> @+status:U32 -> Code
def from_http source · line 139 · raw
@+status:U32 -> Code
The code a client infers from a non-200 status with no Connect error body.