use super::*;
define_error_catalog! {
CORE_SERIALIZATION_FAILED {
code: "core.serialization.failed",
class: ErrorClass::INTERNAL,
condition: CanonicalCondition::Internal,
fault: FaultAttribution::Unknown,
component: ComponentId::CORE,
public_message: "Serialization failed",
severity: ErrorSeverity::Error,
recovery_hint: RecoveryHint::Never,
backtrace: BacktracePolicy::OnDemand,
exposure: Exposure::Generic,
fields: [
fields::OPERATION_DIAGNOSTIC,
fields::FORMAT,
fields::FIELD,
fields::SOURCE_PRESENT,
fields::DETAIL_PRESENT,
],
projection: {
remoting: RemotingResponseCode::SystemError,
grpc: {
payload: GrpcPayloadCode::InternalError,
status: GrpcStatusCode::Internal,
},
http: HttpStatusCode::INTERNAL_SERVER_ERROR,
cli: CliExitCode::SOFTWARE,
},
}
CORE_CONFIGURATION_PARSE_FAILED {
code: "core.configuration.parse_failed",
class: ErrorClass::VALIDATION,
condition: CanonicalCondition::InvalidArgument,
fault: FaultAttribution::Configuration,
component: ComponentId::CORE,
public_message: "Configuration parsing failed",
severity: ErrorSeverity::Error,
recovery_hint: RecoveryHint::Never,
backtrace: BacktracePolicy::Never,
exposure: Exposure::Generic,
fields: [fields::KEY, fields::REASON_PRESENT],
projection: {
remoting: RemotingResponseCode::InvalidParameter,
grpc: {
payload: GrpcPayloadCode::BadRequest,
status: GrpcStatusCode::InvalidArgument,
},
http: HttpStatusCode::BAD_REQUEST,
cli: CliExitCode::CONFIG,
},
}
CORE_CONFIGURATION_MISSING {
code: "core.configuration.missing",
class: ErrorClass::VALIDATION,
condition: CanonicalCondition::InvalidArgument,
fault: FaultAttribution::Configuration,
component: ComponentId::CORE,
public_message: "Required configuration is missing",
severity: ErrorSeverity::Info,
recovery_hint: RecoveryHint::Never,
backtrace: BacktracePolicy::Never,
exposure: Exposure::Generic,
fields: [fields::KEY],
projection: {
remoting: RemotingResponseCode::InvalidParameter,
grpc: {
payload: GrpcPayloadCode::BadRequest,
status: GrpcStatusCode::InvalidArgument,
},
http: HttpStatusCode::BAD_REQUEST,
cli: CliExitCode::CONFIG,
},
}
CORE_CONFIGURATION_INVALID {
code: "core.configuration.invalid",
class: ErrorClass::VALIDATION,
condition: CanonicalCondition::InvalidArgument,
fault: FaultAttribution::Configuration,
component: ComponentId::CORE,
public_message: "Configuration value is invalid",
severity: ErrorSeverity::Info,
recovery_hint: RecoveryHint::Never,
backtrace: BacktracePolicy::Never,
exposure: Exposure::Generic,
fields: [fields::KEY, fields::VALUE_PRESENT, fields::REASON_PRESENT],
projection: {
remoting: RemotingResponseCode::InvalidParameter,
grpc: {
payload: GrpcPayloadCode::BadRequest,
status: GrpcStatusCode::InvalidArgument,
},
http: HttpStatusCode::BAD_REQUEST,
cli: CliExitCode::CONFIG,
},
}
CORE_IO_FAILED {
code: "core.io.failed",
class: ErrorClass::IO,
condition: CanonicalCondition::Internal,
fault: FaultAttribution::LocalResource,
component: ComponentId::CORE,
public_message: "I/O operation failed",
severity: ErrorSeverity::Error,
recovery_hint: RecoveryHint::Never,
backtrace: BacktracePolicy::Never,
exposure: Exposure::Generic,
fields: [fields::OPERATION_DIAGNOSTIC, fields::SOURCE_PRESENT],
projection: {
remoting: RemotingResponseCode::SystemError,
grpc: {
payload: GrpcPayloadCode::InternalError,
status: GrpcStatusCode::Internal,
},
http: HttpStatusCode::INTERNAL_SERVER_ERROR,
cli: CliExitCode::SOFTWARE,
},
}
CORE_ARGUMENT_INVALID {
code: "core.argument.invalid",
class: ErrorClass::VALIDATION,
condition: CanonicalCondition::InvalidArgument,
fault: FaultAttribution::Caller,
component: ComponentId::CORE,
public_message: "Argument is invalid",
severity: ErrorSeverity::Info,
recovery_hint: RecoveryHint::Never,
backtrace: BacktracePolicy::Never,
exposure: Exposure::Generic,
fields: [fields::MESSAGE_PRESENT],
projection: {
remoting: RemotingResponseCode::InvalidParameter,
grpc: {
payload: GrpcPayloadCode::BadRequest,
status: GrpcStatusCode::InvalidArgument,
},
http: HttpStatusCode::BAD_REQUEST,
cli: CliExitCode::USAGE,
},
}
CORE_OPERATION_TIMED_OUT {
code: "core.operation.timed_out",
class: ErrorClass::TIMEOUT,
condition: CanonicalCondition::DeadlineExceeded,
fault: FaultAttribution::Dependency,
component: ComponentId::CORE,
public_message: "Operation timed out",
severity: ErrorSeverity::Warn,
recovery_hint: RecoveryHint::Backoff,
backtrace: BacktracePolicy::Never,
exposure: Exposure::Public,
fields: [fields::OPERATION_DIAGNOSTIC, fields::TIMEOUT_MS],
projection: {
remoting: RemotingResponseCode::SystemBusy,
grpc: {
payload: GrpcPayloadCode::RequestTimeout,
status: GrpcStatusCode::DeadlineExceeded,
},
http: HttpStatusCode::GATEWAY_TIMEOUT,
cli: CliExitCode::TEMPORARY_FAILURE,
},
}
CORE_SERVICE_FAILED {
code: "core.service.failed",
class: ErrorClass::INTERNAL,
condition: CanonicalCondition::Internal,
fault: FaultAttribution::LocalResource,
component: ComponentId::CORE,
public_message: "Service lifecycle operation failed",
severity: ErrorSeverity::Error,
recovery_hint: RecoveryHint::Never,
backtrace: BacktracePolicy::OnDemand,
exposure: Exposure::Generic,
fields: [fields::OPERATION_DIAGNOSTIC],
projection: {
remoting: RemotingResponseCode::SystemError,
grpc: {
payload: GrpcPayloadCode::InternalError,
status: GrpcStatusCode::Internal,
},
http: HttpStatusCode::INTERNAL_SERVER_ERROR,
cli: CliExitCode::SOFTWARE,
},
}
CORE_LIFECYCLE_NOT_INITIALIZED {
code: "core.lifecycle.not_initialized",
class: ErrorClass::VALIDATION,
condition: CanonicalCondition::FailedPrecondition,
fault: FaultAttribution::Caller,
component: ComponentId::CORE,
public_message: "Component is not initialized",
severity: ErrorSeverity::Error,
recovery_hint: RecoveryHint::Never,
backtrace: BacktracePolicy::Never,
exposure: Exposure::Generic,
fields: [fields::COMPONENT_NAME, fields::REASON_PRESENT],
projection: {
remoting: RemotingResponseCode::SystemError,
grpc: {
payload: GrpcPayloadCode::InternalError,
status: GrpcStatusCode::FailedPrecondition,
},
http: HttpStatusCode::CONFLICT,
cli: CliExitCode::DATA,
},
}
}