public static final class ErrorMetadata.Builder extends com.google.protobuf.GeneratedMessage.Builder<ErrorMetadata.Builder> 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 | Method and Description |
|---|---|
ErrorMetadata |
build() |
ErrorMetadata |
buildPartial() |
ErrorMetadata.Builder |
clear() |
ErrorMetadata.Builder |
clearHasDetails()
Indicates whether this error supports rich, typed detail messages.
|
ErrorMetadata.Builder |
clearStatusCode()
Maps the error to a standard gRPC status code for transport-level compatibility.
|
ErrorMetadata |
getDefaultInstanceForType() |
static com.google.protobuf.Descriptors.Descriptor |
getDescriptor() |
com.google.protobuf.Descriptors.Descriptor |
getDescriptorForType() |
boolean |
getHasDetails()
Indicates whether this error supports rich, typed detail messages.
|
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.
|
protected com.google.protobuf.GeneratedMessage.FieldAccessorTable |
internalGetFieldAccessorTable() |
boolean |
isInitialized() |
ErrorMetadata.Builder |
mergeFrom(com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry) |
ErrorMetadata.Builder |
mergeFrom(ErrorMetadata other) |
ErrorMetadata.Builder |
mergeFrom(com.google.protobuf.Message other) |
ErrorMetadata.Builder |
setHasDetails(boolean value)
Indicates whether this error supports rich, typed detail messages.
|
ErrorMetadata.Builder |
setStatusCode(Code value)
Maps the error to a standard gRPC status code for transport-level compatibility.
|
ErrorMetadata.Builder |
setStatusCodeValue(int value)
Maps the error to a standard gRPC status code for transport-level compatibility.
|
addRepeatedField, clearField, clearOneof, clone, getAllFields, getField, getFieldBuilder, getOneofFieldDescriptor, getParentForChildren, getRepeatedField, getRepeatedFieldBuilder, getRepeatedFieldCount, getUnknownFields, getUnknownFieldSetBuilder, hasField, hasOneof, internalGetMapField, internalGetMapFieldReflection, internalGetMutableMapField, internalGetMutableMapFieldReflection, isClean, markClean, mergeUnknownFields, mergeUnknownLengthDelimitedField, mergeUnknownVarintField, newBuilderForField, onBuilt, onChanged, parseUnknownField, setField, setRepeatedField, setUnknownFields, setUnknownFieldSetBuilder, setUnknownFieldsProto3findInitializationErrors, getInitializationErrorString, internalMergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, newUninitializedMessageException, toStringaddAll, addAll, mergeDelimitedFrom, mergeDelimitedFrom, newUninitializedMessageExceptionequals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitpublic static final com.google.protobuf.Descriptors.Descriptor getDescriptor()
protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable()
internalGetFieldAccessorTable in class com.google.protobuf.GeneratedMessage.Builder<ErrorMetadata.Builder>public ErrorMetadata.Builder clear()
clear in interface com.google.protobuf.Message.Builderclear in interface com.google.protobuf.MessageLite.Builderclear in class com.google.protobuf.GeneratedMessage.Builder<ErrorMetadata.Builder>public com.google.protobuf.Descriptors.Descriptor getDescriptorForType()
getDescriptorForType in interface com.google.protobuf.Message.BuildergetDescriptorForType in interface com.google.protobuf.MessageOrBuildergetDescriptorForType in class com.google.protobuf.GeneratedMessage.Builder<ErrorMetadata.Builder>public ErrorMetadata getDefaultInstanceForType()
getDefaultInstanceForType in interface com.google.protobuf.MessageLiteOrBuildergetDefaultInstanceForType in interface com.google.protobuf.MessageOrBuilderpublic ErrorMetadata build()
build in interface com.google.protobuf.Message.Builderbuild in interface com.google.protobuf.MessageLite.Builderpublic ErrorMetadata buildPartial()
buildPartial in interface com.google.protobuf.Message.BuilderbuildPartial in interface com.google.protobuf.MessageLite.Builderpublic ErrorMetadata.Builder mergeFrom(com.google.protobuf.Message other)
mergeFrom in interface com.google.protobuf.Message.BuildermergeFrom in class com.google.protobuf.AbstractMessage.Builder<ErrorMetadata.Builder>public ErrorMetadata.Builder mergeFrom(ErrorMetadata other)
public final boolean isInitialized()
isInitialized in interface com.google.protobuf.MessageLiteOrBuilderisInitialized in class com.google.protobuf.GeneratedMessage.Builder<ErrorMetadata.Builder>public ErrorMetadata.Builder mergeFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException
mergeFrom in interface com.google.protobuf.Message.BuildermergeFrom in interface com.google.protobuf.MessageLite.BuildermergeFrom in class com.google.protobuf.AbstractMessage.Builder<ErrorMetadata.Builder>java.io.IOExceptionpublic 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 ErrorMetadata.Builder setStatusCodeValue(int value)
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;value - The enum numeric value on the wire for statusCode to set.public 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 ErrorMetadata.Builder setStatusCode(Code value)
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;value - The statusCode to set.public ErrorMetadata.Builder clearStatusCode()
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;public 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 ErrorMetadata.Builder setHasDetails(boolean value)
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;value - The hasDetails to set.public ErrorMetadata.Builder clearHasDetails()
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;