Code enum

Connect represents categories of errors as codes, and each code maps to a specific HTTP status code. The codes and their semantics were chosen to match gRPC. Only the codes below are valid — there are no user-defined codes.

See the specification at https://connectrpc.com/docs/protocol#error-codes for details.

Inheritance
Available extensions

Values

canceled → const Code

Canceled, usually be the user

const Code(1, 'canceled')
unknown → const Code

Unknown error

const Code(2, 'unknown')
invalidArgument → const Code

Argument invalid regardless of system state

const Code(3, 'invalid_argument')
deadlineExceeded → const Code

Operation expired, may or may not have completed.

const Code(4, 'deadline_exceeded')
notFound → const Code

Entity not found.

const Code(5, 'not_found')
alreadyExists → const Code

Entity already exists.

const Code(6, 'already_exists')
permissionDenied → const Code

Operation not authorized.

const Code(7, 'permission_denied')
resourceExhausted → const Code

Quota exhausted.

const Code(8, 'resource_exhausted')
failedPrecondition → const Code

Argument invalid in current system state.

const Code(9, 'failed_precondition')
aborted → const Code

Operation aborted.

const Code(10, 'aborted')
outOfRange → const Code

Out of bounds, use instead of FailedPrecondition.

const Code(11, 'out_of_range')
unimplemented → const Code

Operation not implemented or disabled.

const Code(12, 'unimplemented')
internal → const Code

Internal error, reserved for "serious errors".

const Code(13, 'internal')
unavailable → const Code

Unavailable, client should back off and retry.

const Code(14, 'unavailable')
dataLoss → const Code

Unrecoverable data loss or corruption.

const Code(15, 'data_loss')
unauthenticated → const Code

Request isn't authenticated.

const Code(16, 'unauthenticated')

Properties

hashCode → int
The hash code for this object.
no setterinherited
index → int
A numeric identifier for the enumerated value.
no setterinherited
name → String
final
name → String

Available on Enum, provided by the EnumName extension

The name of the enum value.
no setter
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
value → int
Numerical value of the enum.
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited

Constants

values → const List<Code>
A constant List of the values in this enum, in order of their declaration.