StatusCode enum

Canonical status codes for Genkit operations.

These correspond to gRPC status codes. Use wireName (e.g. NOT_FOUND) when a status crosses a process boundary; name follows Dart naming and is not part of the wire format.

Inheritance
Available extensions

Values

ok → const StatusCode

The operation completed successfully.

const StatusCode(0, 'OK')
cancelled → const StatusCode

The operation was cancelled, typically by the caller.

const StatusCode(1, 'CANCELLED')
unknown → const StatusCode

Unknown error.

const StatusCode(2, 'UNKNOWN')
invalidArgument → const StatusCode

The client specified an invalid argument.

const StatusCode(3, 'INVALID_ARGUMENT')
deadlineExceeded → const StatusCode

The deadline expired before the operation could complete.

const StatusCode(4, 'DEADLINE_EXCEEDED')
notFound → const StatusCode

Some requested entity (e.g., file or directory) was not found.

const StatusCode(5, 'NOT_FOUND')
alreadyExists → const StatusCode

The entity that a client attempted to create (e.g., file or directory) already exists.

const StatusCode(6, 'ALREADY_EXISTS')
permissionDenied → const StatusCode

The caller does not have permission to execute the specified operation.

const StatusCode(7, 'PERMISSION_DENIED')
unauthenticated → const StatusCode

The request does not have valid authentication credentials for the operation.

const StatusCode(16, 'UNAUTHENTICATED')
resourceExhausted → const StatusCode

Some resource has been exhausted, perhaps a per-user quota.

const StatusCode(8, 'RESOURCE_EXHAUSTED')
failedPrecondition → const StatusCode

The operation was rejected because the system is not in a state required for the operation's execution.

const StatusCode(9, 'FAILED_PRECONDITION')
aborted → const StatusCode

The operation was aborted, typically due to a concurrency issue.

const StatusCode(10, 'ABORTED')
outOfRange → const StatusCode

The operation was attempted past the valid range.

const StatusCode(11, 'OUT_OF_RANGE')
unimplemented → const StatusCode

The operation is not implemented or is not supported/enabled.

const StatusCode(12, 'UNIMPLEMENTED')
internal → const StatusCode

Internal errors.

const StatusCode(13, 'INTERNAL')
unavailable → const StatusCode

The service is currently unavailable.

const StatusCode(14, 'UNAVAILABLE')
dataLoss → const StatusCode

Unrecoverable data loss or corruption.

const StatusCode(15, 'DATA_LOSS')

Properties

hashCode → int
The hash code for this object.
no setterinherited
httpStatus → int
no setter
index → int
A numeric identifier for the enumerated value.
no setterinherited
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
The numeric gRPC status code.
final
wireName → String
The canonical gRPC status name (e.g. NOT_FOUND), as used in JSON payloads, HTTP error bodies and other Genkit SDKs.
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

Static Methods

fromHttpStatus(int code) → StatusCode
Maps an HTTP status code to the closest StatusCode value.
fromWireName(String wireName) → StatusCode
Parses a canonical status name (see wireName).

Constants

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