public final class ErrorMetadata extends com.google.protobuf.GeneratedMessage implements ErrorMetadataOrBuilder
ErrorMetadata provides actionable information for error enum values to enable automated
code generation, documentation, and consistent error handling across the Kurrent platform.
It was modeled to support a single details type per error code to simplify code generation and
validation. If multiple detail types are needed for a single error code, consider defining
separate error codes for each detail type. Or, use a union type (oneof) in the detail message
to encapsulate multiple detail variants within a single detail message.
More however DebugInfo and RetryInfo can and should be added to any error regardless of
this setting, when applicable.
This annotation is applied to enum values using the google.protobuf.EnumValueOptions
extension mechanism. It enables:
- Automatic gRPC status code mapping
- Code generation for error handling utilities
- Documentation generation
- Type-safe error detail validation
Usage Example:
enum StreamErrorCode {
REVISION_CONFLICT = 5 [(kurrent.rpc.error) = {
status_code: FAILED_PRECONDITION,
has_details: true
}];
}
See individual field documentation for conventions and defaults.
Protobuf type kurrent.rpc.ErrorMetadata| Modifier and Type | Class and Description |
|---|---|
static class |
ErrorMetadata.Builder
ErrorMetadata provides actionable information for error enum values to enable automated
code generation, documentation, and consistent error handling across the Kurrent platform.
|
com.google.protobuf.GeneratedMessage.ExtendableBuilder<MessageT extends com.google.protobuf.GeneratedMessage.ExtendableMessage<MessageT>,BuilderT extends com.google.protobuf.GeneratedMessage.ExtendableBuilder<MessageT,BuilderT>>, com.google.protobuf.GeneratedMessage.ExtendableMessage<MessageT extends com.google.protobuf.GeneratedMessage.ExtendableMessage<MessageT>>, com.google.protobuf.GeneratedMessage.ExtendableMessageOrBuilder<MessageT extends com.google.protobuf.GeneratedMessage.ExtendableMessage<MessageT>>, com.google.protobuf.GeneratedMessage.FieldAccessorTable, com.google.protobuf.GeneratedMessage.GeneratedExtension<ContainingT extends com.google.protobuf.Message,T>, com.google.protobuf.GeneratedMessage.UnusedPrivateParameter| Modifier and Type | Field and Description |
|---|---|
static int |
HAS_DETAILS_FIELD_NUMBER |
static int |
STATUS_CODE_FIELD_NUMBER |
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(java.lang.Object obj) |
static ErrorMetadata |
getDefaultInstance() |
ErrorMetadata |
getDefaultInstanceForType() |
static com.google.protobuf.Descriptors.Descriptor |
getDescriptor() |
boolean |
getHasDetails()
Indicates whether this error supports rich, typed detail messages.
|
com.google.protobuf.Parser<ErrorMetadata> |
getParserForType() |
int |
getSerializedSize() |
Code |
getStatusCode()
Maps the error to a standard gRPC status code for transport-level compatibility.
|
int |
getStatusCodeValue()
Maps the error to a standard gRPC status code for transport-level compatibility.
|
int |
hashCode() |
protected com.google.protobuf.GeneratedMessage.FieldAccessorTable |
internalGetFieldAccessorTable() |
boolean |
isInitialized() |
static ErrorMetadata.Builder |
newBuilder() |
static ErrorMetadata.Builder |
newBuilder(ErrorMetadata prototype) |
ErrorMetadata.Builder |
newBuilderForType() |
protected ErrorMetadata.Builder |
newBuilderForType(com.google.protobuf.AbstractMessage.BuilderParent parent) |
static ErrorMetadata |
parseDelimitedFrom(java.io.InputStream input) |
static ErrorMetadata |
parseDelimitedFrom(java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry) |
static ErrorMetadata |
parseFrom(byte[] data) |
static ErrorMetadata |
parseFrom(byte[] data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry) |
static ErrorMetadata |
parseFrom(java.nio.ByteBuffer data) |
static ErrorMetadata |
parseFrom(java.nio.ByteBuffer data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry) |
static ErrorMetadata |
parseFrom(com.google.protobuf.ByteString data) |
static ErrorMetadata |
parseFrom(com.google.protobuf.ByteString data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry) |
static ErrorMetadata |
parseFrom(com.google.protobuf.CodedInputStream input) |
static ErrorMetadata |
parseFrom(com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry) |
static ErrorMetadata |
parseFrom(java.io.InputStream input) |
static ErrorMetadata |
parseFrom(java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry) |
static com.google.protobuf.Parser<ErrorMetadata> |
parser() |
ErrorMetadata.Builder |
toBuilder() |
void |
writeTo(com.google.protobuf.CodedOutputStream output) |
canUseUnsafe, computeStringSize, computeStringSizeNoTag, emptyBooleanList, emptyDoubleList, emptyFloatList, emptyIntList, emptyList, emptyLongList, getAllFields, getDescriptorForType, getField, getOneofFieldDescriptor, getRepeatedField, getRepeatedFieldCount, getUnknownFields, hasField, hasOneof, internalGetMapField, internalGetMapFieldReflection, isStringEmpty, makeMutableCopy, makeMutableCopy, mergeFromAndMakeImmutableInternal, newFileScopedGeneratedExtension, newInstance, newMessageScopedGeneratedExtension, parseDelimitedWithIOException, parseDelimitedWithIOException, parseUnknownField, parseUnknownFieldProto3, parseWithIOException, parseWithIOException, parseWithIOException, parseWithIOException, serializeBooleanMapTo, serializeIntegerMapTo, serializeLongMapTo, serializeStringMapTo, writeReplace, writeString, writeStringNoTagfindInitializationErrors, getInitializationErrorString, hashFields, toStringaddAll, checkByteStringIsUtf8, toByteArray, toByteString, writeDelimitedTo, writeToclone, finalize, getClass, notify, notifyAll, wait, wait, waitpublic static final int STATUS_CODE_FIELD_NUMBER
public static final int HAS_DETAILS_FIELD_NUMBER
public static final com.google.protobuf.Descriptors.Descriptor getDescriptor()
protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable()
internalGetFieldAccessorTable in class com.google.protobuf.GeneratedMessagepublic int getStatusCodeValue()
Maps the error to a standard gRPC status code for transport-level compatibility. This field is REQUIRED for every error annotation. Use standard gRPC status codes from `google.rpc.code`. Code generators use this to: - Map errors to gRPC status codes automatically - Generate HTTP status code mappings - Create transport-agnostic error handling
.google.rpc.Code status_code = 1;getStatusCodeValue in interface ErrorMetadataOrBuilderpublic Code getStatusCode()
Maps the error to a standard gRPC status code for transport-level compatibility. This field is REQUIRED for every error annotation. Use standard gRPC status codes from `google.rpc.code`. Code generators use this to: - Map errors to gRPC status codes automatically - Generate HTTP status code mappings - Create transport-agnostic error handling
.google.rpc.Code status_code = 1;getStatusCode in interface ErrorMetadataOrBuilderpublic boolean getHasDetails()
Indicates whether this error supports rich, typed detail messages.
Defaults to false (simple message string only).
The message type name must be derived from the enum name by convention.
Mask: {EnumValue}ErrorDetails, {EnumValue}Error, {EnumValue}
Examples:
ACCESS_DENIED -> "AccessDeniedErrorDetails", "AccessDeniedError" or "AccessDenied"
SERVER_NOT_READY -> "ServerNotReadyErrorDetails", "ServerNotReadyError" or "ServerNotReady"
Code generators use the message type name to:
- Validate that the detail message matches the expected type
- Generate type-safe error handling code
- Create accurate documentation
bool has_details = 2;getHasDetails in interface ErrorMetadataOrBuilderpublic final boolean isInitialized()
isInitialized in interface com.google.protobuf.MessageLiteOrBuilderisInitialized in class com.google.protobuf.GeneratedMessagepublic void writeTo(com.google.protobuf.CodedOutputStream output)
throws java.io.IOException
writeTo in interface com.google.protobuf.MessageLitewriteTo in class com.google.protobuf.GeneratedMessagejava.io.IOExceptionpublic int getSerializedSize()
getSerializedSize in interface com.google.protobuf.MessageLitegetSerializedSize in class com.google.protobuf.GeneratedMessagepublic boolean equals(java.lang.Object obj)
equals in interface com.google.protobuf.Messageequals in class com.google.protobuf.AbstractMessagepublic int hashCode()
hashCode in interface com.google.protobuf.MessagehashCode in class com.google.protobuf.AbstractMessagepublic static ErrorMetadata parseFrom(java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException
com.google.protobuf.InvalidProtocolBufferExceptionpublic static ErrorMetadata parseFrom(java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException
com.google.protobuf.InvalidProtocolBufferExceptionpublic static ErrorMetadata parseFrom(com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException
com.google.protobuf.InvalidProtocolBufferExceptionpublic static ErrorMetadata parseFrom(com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException
com.google.protobuf.InvalidProtocolBufferExceptionpublic static ErrorMetadata parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException
com.google.protobuf.InvalidProtocolBufferExceptionpublic static ErrorMetadata parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException
com.google.protobuf.InvalidProtocolBufferExceptionpublic static ErrorMetadata parseFrom(java.io.InputStream input) throws java.io.IOException
java.io.IOExceptionpublic static ErrorMetadata parseFrom(java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException
java.io.IOExceptionpublic static ErrorMetadata parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException
java.io.IOExceptionpublic static ErrorMetadata parseDelimitedFrom(java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException
java.io.IOExceptionpublic static ErrorMetadata parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException
java.io.IOExceptionpublic static ErrorMetadata parseFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException
java.io.IOExceptionpublic ErrorMetadata.Builder newBuilderForType()
newBuilderForType in interface com.google.protobuf.MessagenewBuilderForType in interface com.google.protobuf.MessageLitepublic static ErrorMetadata.Builder newBuilder()
public static ErrorMetadata.Builder newBuilder(ErrorMetadata prototype)
public ErrorMetadata.Builder toBuilder()
toBuilder in interface com.google.protobuf.MessagetoBuilder in interface com.google.protobuf.MessageLiteprotected ErrorMetadata.Builder newBuilderForType(com.google.protobuf.AbstractMessage.BuilderParent parent)
newBuilderForType in class com.google.protobuf.AbstractMessagepublic static ErrorMetadata getDefaultInstance()
public static com.google.protobuf.Parser<ErrorMetadata> parser()
public com.google.protobuf.Parser<ErrorMetadata> getParserForType()
getParserForType in interface com.google.protobuf.MessagegetParserForType in interface com.google.protobuf.MessageLitegetParserForType in class com.google.protobuf.GeneratedMessagepublic ErrorMetadata getDefaultInstanceForType()
getDefaultInstanceForType in interface com.google.protobuf.MessageLiteOrBuildergetDefaultInstanceForType in interface com.google.protobuf.MessageOrBuilder