RPCStatus

object RPCStatus

Define the standard RPC code that can be used for generic RPC service implementation.

This covers all gRPC statuses and have pre-defined mappings to HTTP status (4xx, 5xx) code.

If you need an application-specific error code, use an additional argument of the RPCError class.

Companion:
class
trait Sum
trait Mirror
class Object
trait Matchable
class Any

Type members

Classlikes

case object ABORTED_U12 extends RPCStatus

The request is aborted (e.g., dead-lock, transaction conflicts, etc.) The client should retry the request it a higher-level.

The request is aborted (e.g., dead-lock, transaction conflicts, etc.) The client should retry the request it a higher-level.

case object ALREADY_EXISTS_U6 extends RPCStatus

The resource creation request failed because it already exists.

The resource creation request failed because it already exists.

case object CANCELLED_U11 extends RPCStatus

The request was cancelled, typically by the client. The client should not retry the request unless it's a network issue.

The request was cancelled, typically by the client. The client should not retry the request unless it's a network issue.

case object DATA_LOSS_I8 extends RPCStatus

Data loss or corrupted data

Data loss or corrupted data

case object DEADLINE_EXCEEDED_I4 extends RPCStatus

The request cannot be processed in the user-specified deadline. The client may retry the request

The request cannot be processed in the user-specified deadline. The client may retry the request

case object EXCEEDED_BUDGET_R8 extends RPCStatus

The user has exhausted the budget for processing the request.

The user has exhausted the budget for processing the request.

case object EXCEEDED_CPU_LIMIT_R3 extends RPCStatus

The user has reached its CPU usage limit

The user has reached its CPU usage limit

The user has reached its data size limit

The user has reached its data size limit

The user has reached its memory usage limit

The user has reached its memory usage limit

case object EXCEEDED_RATE_LIMIT_R2 extends RPCStatus

There are too many requests. The user needs to retry the request after a while

There are too many requests. The user needs to retry the request after a while

The user has reached its storage size limit

The user has reached its storage size limit

case object EXCEEDED_TIME_LIMIT_R5 extends RPCStatus

The user has reached its running time limit

The user has reached its running time limit

case object INCONSISTENT_STATE_U10 extends RPCStatus

The service or the use has an inconsistent state and cannot fulfill the request. The client should not retry the request until fixing the state.

The service or the use has an inconsistent state and cannot fulfill the request. The client should not retry the request until fixing the state.

case object INTERNAL_ERROR_I0 extends RPCStatus

Internal failures where the user can retry the request in general

Internal failures where the user can retry the request in general

case object INTERRUPTED_I5 extends RPCStatus

The request is interrupted at the service

The request is interrupted at the service

case object INVALID_ARGUMENT_U2 extends RPCStatus

RPC request arguments have invalid values

RPC request arguments have invalid values

case object INVALID_REQUEST_U1 extends RPCStatus

Invalid RPC request. The user should not retry the request in general.

Invalid RPC request. The user should not retry the request in general.

case object NOT_FOUND_U5 extends RPCStatus

The requested resource or RPC method is not found

The requested resource or RPC method is not found

case object NOT_SUPPORTED_U7 extends RPCStatus

The requested RPC method is not supported.

The requested RPC method is not supported.

case object OUT_OF_MEMORY_R1 extends RPCStatus

The service is experiencing insufficient memory

The service is experiencing insufficient memory

case object OUT_OF_RANGE_U4 extends RPCStatus

Invalid range data is given to an RPC request argument.

Invalid range data is given to an RPC request argument.

case object PERMISSION_DENIED_U14 extends RPCStatus

The user does not have a permission to access the resource

The user does not have a permission to access the resource

case object RESOURCE_EXHAUSTED_R0 extends RPCStatus

The resource for completing the request is insufficient.

The resource for completing the request is insufficient.

The service is shutting down now.

The service is shutting down now.

case object SERVICE_STARTING_UP_I6 extends RPCStatus

The service is starting now. The client can retry the request after a while

The service is starting now. The client can retry the request after a while

case object SUCCESS_S0 extends RPCStatus
case object SYNTAX_ERROR_U3 extends RPCStatus

Syntax error in an RPC argument

Syntax error in an RPC argument

case object TIMEOUT_I3 extends RPCStatus

The service respond the request in time (e.g., circuit breaker is open, timeout exceeded, etc.) For operations that change the system state, this error might be returned even if the operation has completed successfully.

The service respond the request in time (e.g., circuit breaker is open, timeout exceeded, etc.) For operations that change the system state, this error might be returned even if the operation has completed successfully.

case object UNAUTHENTICATED_U13 extends RPCStatus

The user has not been authenticated

The user has not been authenticated

case object UNAVAILABLE_I2 extends RPCStatus

The service is unavailable.

The service is unavailable.

case object UNEXPECTED_STATE_U9 extends RPCStatus

Some precondition to succeed this request is not met (e.g., invalid configuration). The client should not retry the request until fixing the state.

Some precondition to succeed this request is not met (e.g., invalid configuration). The client should not retry the request until fixing the state.

case object UNIMPLEMENTED_U8 extends RPCStatus

The requested RPC method is not implemented.

The requested RPC method is not implemented.

case object UNKNOWN_I1 extends RPCStatus

An unknown internal error

An unknown internal error

case object USER_ERROR_U0 extends RPCStatus

Inherited types

type MirroredElemLabels <: Tuple

The names of the product elements

The names of the product elements

Inherited from:
Mirror
type MirroredLabel <: String

The name of the type

The name of the type

Inherited from:
Mirror

Value members

Concrete methods

def all: Seq[RPCStatus]
def fromGrpcStatusCode(grpcStatusCode: Int): RPCStatus

Mapping HttpStatus to RPCStatus. This is useful when mapping third-party API statuses into RPCStatus

Mapping HttpStatus to RPCStatus. This is useful when mapping third-party API statuses into RPCStatus

def ofCode(code: Int): RPCStatus
def ofCodeName(name: String): RPCStatus
def unapply(s: String): Option[RPCStatus]
def unapply(v: Value): Option[RPCStatus]