abstract class ErrorCode extends AnyRef
Error Code Definition
We want to support our users and our developers with good error codes. Therefore, every error that an API returns should refer to a documented error code and provide some context information.
Every error code is uniquely identified using an error-id of max 63 CAPITALIZED_WITH_UNDERSCORES characters
Errors are organised according to ErrorGroups. And we separate the error code definition (using a singleton by virtue of using objects to express the nested hierarchy) and the actual error.
Please note that there is some implicit argument passing involved in the example below:
object SyncServiceErrors extends ParticipantErrorGroup { object ConnectionErrors extends ErrorGroup { object DomainUnavailable extends ErrorCode(id="DOMAIN_UNAVAILABLE", ..) { case class ActualError(someContext: Val) extends BaseError with SyncServiceError // this error will actually be referring to the same error code! case class OtherError(otherContext: Val) extends BaseError with SyncServiceError } } object HandshakeErrors extends ErrorGroup { ... } }
- Alphabetic
- By Inheritance
- ErrorCode
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Instance Constructors
- new ErrorCode(id: String, category: ErrorCategory)(implicit parent: ErrorClass)
Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##: Int
- Definition Classes
- AnyRef → Any
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- def asGrpcError(err: BaseError)(implicit loggingContext: ContextualizedErrorLogger): StatusRuntimeException
- def asGrpcStatus(err: BaseError)(implicit loggingContext: ContextualizedErrorLogger): Status
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- val category: ErrorCategory
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native() @HotSpotIntrinsicCandidate()
- implicit val code: ErrorCode
- def codeStr(correlationId: Option[String]): String
The machine readable error code string, uniquely identifiable by the error id, error category and correlation id.
The machine readable error code string, uniquely identifiable by the error id, error category and correlation id. e.g. NO_DOMAINS_CONNECTED(2,ABC234)
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- def errorConveyanceDocString: Option[String]
The error conveyance doc string provides a statement about the form this error will be returned to the user
- def exposedViaApi: Boolean
True if this error may appear on the API
True if this error may appear on the API
- Attributes
- protected
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @HotSpotIntrinsicCandidate()
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @HotSpotIntrinsicCandidate()
- val id: String
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- def logLevel: Level
Log level of the error code
Log level of the error code
Generally, the log level is defined by the error category. In rare cases, it might be overridden by the error code.
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @HotSpotIntrinsicCandidate()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @HotSpotIntrinsicCandidate()
- implicit val parent: ErrorClass
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def toMsg(cause: => String, correlationId: Option[String]): String
- returns
message including error category id, error code id, correlation id and cause
- def toString(): String
- Definition Classes
- AnyRef → Any
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])