use super::*;
define_error_catalog! {
BROKER_LOOKUP_NOT_FOUND {
code: "broker.lookup.not_found",
class: ErrorClass::ROUTING,
condition: CanonicalCondition::NotFound,
fault: FaultAttribution::RemotePeer,
component: ComponentId::BROKER,
public_message: "Broker was not found",
severity: ErrorSeverity::Error,
recovery_hint: RecoveryHint::SwitchBroker,
backtrace: BacktracePolicy::Never,
exposure: Exposure::Public,
fields: [fields::BROKER],
projection: {
remoting: RemotingResponseCode::BrokerNotExist,
grpc: {
payload: GrpcPayloadCode::NotFound,
status: GrpcStatusCode::NotFound,
},
http: HttpStatusCode::NOT_FOUND,
cli: CliExitCode::NOT_FOUND,
},
}
BROKER_REGISTRATION_FAILED {
code: "broker.registration.failed",
class: ErrorClass::UNAVAILABLE,
condition: CanonicalCondition::Unavailable,
fault: FaultAttribution::Dependency,
component: ComponentId::BROKER,
public_message: "Broker registration failed",
severity: ErrorSeverity::Error,
recovery_hint: RecoveryHint::SwitchBroker,
backtrace: BacktracePolicy::Never,
exposure: Exposure::Generic,
fields: [fields::BROKER, fields::REASON_PRESENT],
projection: {
remoting: RemotingResponseCode::SystemError,
grpc: {
payload: GrpcPayloadCode::InternalError,
status: GrpcStatusCode::Unavailable,
},
http: HttpStatusCode::SERVICE_UNAVAILABLE,
cli: CliExitCode::UNAVAILABLE,
},
}
BROKER_OPERATION_FAILED {
code: "broker.operation.failed",
class: ErrorClass::INTERNAL,
condition: CanonicalCondition::Internal,
fault: FaultAttribution::RemotePeer,
component: ComponentId::BROKER,
public_message: "Broker operation failed",
severity: ErrorSeverity::Error,
recovery_hint: RecoveryHint::SwitchBroker,
backtrace: BacktracePolicy::OnDemand,
exposure: Exposure::Generic,
fields: [
fields::OPERATION_DIAGNOSTIC,
fields::BROKER_CODE,
fields::BROKER_ADDR,
fields::MESSAGE_PRESENT,
],
projection: {
remoting: RemotingResponseCode::SystemError,
grpc: {
payload: GrpcPayloadCode::InternalError,
status: GrpcStatusCode::Internal,
},
http: HttpStatusCode::INTERNAL_SERVER_ERROR,
cli: CliExitCode::SOFTWARE,
},
}
BROKER_TOPIC_NOT_FOUND {
code: "broker.topic.not_found",
class: ErrorClass::ROUTING,
condition: CanonicalCondition::NotFound,
fault: FaultAttribution::RemotePeer,
component: ComponentId::BROKER,
public_message: "Topic does not exist",
severity: ErrorSeverity::Warn,
recovery_hint: RecoveryHint::Never,
backtrace: BacktracePolicy::Never,
exposure: Exposure::Public,
fields: [fields::TOPIC],
projection: {
remoting: RemotingResponseCode::TopicNotExist,
grpc: {
payload: GrpcPayloadCode::TopicNotFound,
status: GrpcStatusCode::NotFound,
},
http: HttpStatusCode::NOT_FOUND,
cli: CliExitCode::NOT_FOUND,
},
}
BROKER_QUEUE_NOT_FOUND {
code: "broker.queue.not_found",
class: ErrorClass::ROUTING,
condition: CanonicalCondition::NotFound,
fault: FaultAttribution::RemotePeer,
component: ComponentId::BROKER,
public_message: "Queue does not exist",
severity: ErrorSeverity::Warn,
recovery_hint: RecoveryHint::SwitchBroker,
backtrace: BacktracePolicy::Never,
exposure: Exposure::Public,
fields: [fields::TOPIC, fields::QUEUE_ID],
projection: {
remoting: RemotingResponseCode::QueryNotFound,
grpc: {
payload: GrpcPayloadCode::NotFound,
status: GrpcStatusCode::NotFound,
},
http: HttpStatusCode::NOT_FOUND,
cli: CliExitCode::NOT_FOUND,
},
}
BROKER_SUBSCRIPTION_GROUP_NOT_FOUND {
code: "broker.subscription_group.not_found",
class: ErrorClass::ROUTING,
condition: CanonicalCondition::NotFound,
fault: FaultAttribution::RemotePeer,
component: ComponentId::BROKER,
public_message: "Subscription group does not exist",
severity: ErrorSeverity::Warn,
recovery_hint: RecoveryHint::Backoff,
backtrace: BacktracePolicy::Never,
exposure: Exposure::Public,
fields: [fields::GROUP],
projection: {
remoting: RemotingResponseCode::SubscriptionGroupNotExist,
grpc: {
payload: GrpcPayloadCode::ConsumerGroupNotFound,
status: GrpcStatusCode::NotFound,
},
http: HttpStatusCode::NOT_FOUND,
cli: CliExitCode::NOT_FOUND,
},
}
BROKER_QUEUE_ID_OUT_OF_RANGE {
code: "broker.queue.id_out_of_range",
class: ErrorClass::VALIDATION,
condition: CanonicalCondition::InvalidArgument,
fault: FaultAttribution::Caller,
component: ComponentId::BROKER,
public_message: "Queue id is out of range",
severity: ErrorSeverity::Error,
recovery_hint: RecoveryHint::Never,
backtrace: BacktracePolicy::Never,
exposure: Exposure::Public,
fields: [fields::TOPIC, fields::QUEUE_ID, fields::MAX_QUEUE_ID],
projection: {
remoting: RemotingResponseCode::SystemError,
grpc: {
payload: GrpcPayloadCode::BadRequest,
status: GrpcStatusCode::InvalidArgument,
},
http: HttpStatusCode::BAD_REQUEST,
cli: CliExitCode::USAGE,
},
}
BROKER_MESSAGE_TOO_LARGE {
code: "broker.message.too_large",
class: ErrorClass::CAPACITY,
condition: CanonicalCondition::ResourceExhausted,
fault: FaultAttribution::Caller,
component: ComponentId::BROKER,
public_message: "Message body is too large",
severity: ErrorSeverity::Error,
recovery_hint: RecoveryHint::Never,
backtrace: BacktracePolicy::Never,
exposure: Exposure::Public,
fields: [fields::ACTUAL_BYTES, fields::LIMIT_BYTES],
projection: {
remoting: RemotingResponseCode::MessageIllegal,
grpc: {
payload: GrpcPayloadCode::MessageBodyTooLarge,
status: GrpcStatusCode::ResourceExhausted,
},
http: HttpStatusCode::PAYLOAD_TOO_LARGE,
cli: CliExitCode::DATA,
},
}
BROKER_MESSAGE_INVALID {
code: "broker.message.invalid",
class: ErrorClass::VALIDATION,
condition: CanonicalCondition::InvalidArgument,
fault: FaultAttribution::Caller,
component: ComponentId::BROKER,
public_message: "Message validation failed",
severity: ErrorSeverity::Error,
recovery_hint: RecoveryHint::Never,
backtrace: BacktracePolicy::Never,
exposure: Exposure::Generic,
fields: [fields::REASON_PRESENT],
projection: {
remoting: RemotingResponseCode::MessageIllegal,
grpc: {
payload: GrpcPayloadCode::BadRequest,
status: GrpcStatusCode::InvalidArgument,
},
http: HttpStatusCode::BAD_REQUEST,
cli: CliExitCode::USAGE,
},
}
BROKER_TRANSACTION_REJECTED {
code: "broker.transaction.rejected",
class: ErrorClass::INTERNAL,
condition: CanonicalCondition::Aborted,
fault: FaultAttribution::RemotePeer,
component: ComponentId::BROKER,
public_message: "Transaction message was rejected",
severity: ErrorSeverity::Error,
recovery_hint: RecoveryHint::Never,
backtrace: BacktracePolicy::Never,
exposure: Exposure::Public,
fields: [],
projection: {
remoting: RemotingResponseCode::SystemError,
grpc: {
payload: GrpcPayloadCode::BadRequest,
status: GrpcStatusCode::Aborted,
},
http: HttpStatusCode::CONFLICT,
cli: CliExitCode::DATA,
},
}
BROKER_LEADERSHIP_NOT_MASTER {
code: "broker.leadership.not_master",
class: ErrorClass::ROUTING,
condition: CanonicalCondition::FailedPrecondition,
fault: FaultAttribution::RemotePeer,
component: ComponentId::BROKER,
public_message: "Broker is not the master",
severity: ErrorSeverity::Warn,
recovery_hint: RecoveryHint::RefreshLeader,
backtrace: BacktracePolicy::Never,
exposure: Exposure::Generic,
fields: [fields::MASTER_ADDRESS],
projection: {
remoting: RemotingResponseCode::NotLeaderForQueue,
grpc: {
payload: GrpcPayloadCode::InternalError,
status: GrpcStatusCode::FailedPrecondition,
},
http: HttpStatusCode::CONFLICT,
cli: CliExitCode::DATA,
},
}
BROKER_QUERY_NOT_FOUND {
code: "broker.query.not_found",
class: ErrorClass::ROUTING,
condition: CanonicalCondition::NotFound,
fault: FaultAttribution::RemotePeer,
component: ComponentId::BROKER,
public_message: "Broker query result was not found",
severity: ErrorSeverity::Warn,
recovery_hint: RecoveryHint::Backoff,
backtrace: BacktracePolicy::Never,
exposure: Exposure::Public,
fields: [fields::RESOURCE, fields::OFFSET],
projection: {
remoting: RemotingResponseCode::QueryNotFound,
grpc: {
payload: GrpcPayloadCode::NotFound,
status: GrpcStatusCode::NotFound,
},
http: HttpStatusCode::NOT_FOUND,
cli: CliExitCode::NOT_FOUND,
},
}
BROKER_TASK_FAILED {
code: "broker.task.failed",
class: ErrorClass::INTERNAL,
condition: CanonicalCondition::Internal,
fault: FaultAttribution::LocalResource,
component: ComponentId::BROKER,
public_message: "Broker asynchronous task failed",
severity: ErrorSeverity::Error,
recovery_hint: RecoveryHint::Never,
backtrace: BacktracePolicy::OnDemand,
exposure: Exposure::Generic,
fields: [fields::TASK, fields::SOURCE_PRESENT, fields::CONTEXT_PRESENT],
projection: {
remoting: RemotingResponseCode::SystemError,
grpc: {
payload: GrpcPayloadCode::InternalError,
status: GrpcStatusCode::Internal,
},
http: HttpStatusCode::INTERNAL_SERVER_ERROR,
cli: CliExitCode::SOFTWARE,
},
}
}