Complete reference for all TrustWeave error types.
Error Hierarchy
All TrustWeave exceptions extend the open class TrustWeaveException. Plugin / provider / config / serialization errors live in dedicated sealed subhierarchies (in common), and each domain module ships its own sealed *Exception family.
// Base (open, NOT sealed — domain modules extend it)openclassTrustWeaveException(openvalcode:String,overridevalmessage:String,openvalcontext:Map<String,Any?>=emptyMap(),overridevalcause:Throwable?=null):Exception(message,cause){// Core generic exceptions (nested in this class)data classDigestFailed(...):TrustWeaveException(...)data classEncodeFailed(...):TrustWeaveException(...)data classValidationFailed(...):TrustWeaveException(...)data classInvalidOperation(...):TrustWeaveException(...)data classInvalidState(...):TrustWeaveException(...)data classNotFound(...):TrustWeaveException(...)data classUnsupportedAlgorithm(...):TrustWeaveException(...)data classUnknown(...):TrustWeaveException(...)}// Plugin hierarchy (org.trustweave.core.exception.PluginException)sealedclassPluginException:TrustWeaveException(...){data classNotFound(...):PluginException(...)data classInitializationFailed(...):PluginException(...)data classAlreadyRegistered(...):PluginException(...)objectBlankId:PluginException(...)// singleton, not a data class}// Provider hierarchy (org.trustweave.core.exception.ProviderException)sealedclassProviderException:TrustWeaveException(...){data classNoneFound(...):ProviderException(...)data classPartiallyFound(...):ProviderException(...)data classAllFailed(...):ProviderException(...)}// Configuration hierarchy (org.trustweave.core.exception.ConfigException)sealedclassConfigException:TrustWeaveException(...){data classNotFound(...):ConfigException(...)data classReadFailed(...):ConfigException(...)data classInvalidFormat(...):ConfigException(...)}// JSON / serialization hierarchy (org.trustweave.core.exception.SerializationException)sealedclassSerializationException:TrustWeaveException(...){data classInvalidJson(...):SerializationException(...)data classEncodeFailed(...):SerializationException(...)}// Domain hierarchiessealedclassDidException:TrustWeaveException(...){data classDidNotFound(...);data classDidMethodNotRegistered(...);data classInvalidDidFormat(...);data classDidResolutionFailed(...);data classDidCreationFailed(...);data classDidUpdateFailed(...);data classDidDeactivationFailed(...);data classRequiresAction(...);}sealedclassBlockchainException:TrustWeaveException(...){data classTransactionFailed(...);data classConnectionFailed(...);data classConfigurationFailed(...);data classUnsupportedOperation(...);data classChainNotRegistered(...);}sealedclassWalletException:TrustWeaveException(...){data classWalletCreationFailed(...);data classWalletFactoryNotConfigured(...);data classInvalidHolderDid(...);data classStorageError(...);}sealedclassKmsException:TrustWeaveException(...){data classKeyNotFound(...);data classKeyGenerationFailed(...);data classSigningFailed(...);data classKeyDeletionFailed(...);}// There is NO CredentialException class. Credential issuance/verification// uses sealed result types (IssuanceResult, VerificationResult) instead.
Error Types by Category
Plugin Errors (PluginException)
Error Type
Code
Properties
When It Occurs
PluginException.BlankId (singleton object)
BLANK_PLUGIN_ID
–
Plugin ID is blank
PluginException.AlreadyRegistered
PLUGIN_ALREADY_REGISTERED
pluginId, existingPlugin
Duplicate plugin registration
PluginException.NotFound
PLUGIN_NOT_FOUND
pluginId, pluginType
Plugin lookup fails
PluginException.InitializationFailed
PLUGIN_INITIALIZATION_FAILED
pluginId, reason
Plugin initialization fails
Provider Errors (ProviderException)
Error Type
Code
Properties
When It Occurs
ProviderException.NoneFound
NO_PROVIDERS_FOUND
pluginIds, availablePlugins
No providers found for plugin IDs
ProviderException.PartiallyFound
PARTIAL_PROVIDERS_FOUND
requestedIds, foundIds, missingIds
Some providers found, some missing
ProviderException.AllFailed
ALL_PROVIDERS_FAILED
attemptedProviders, providerErrors, lastException
All providers in chain failed
Configuration Errors (ConfigException)
Error Type
Code
Properties
When It Occurs
ConfigException.NotFound
CONFIG_NOT_FOUND
path
Configuration file/resource not found
ConfigException.ReadFailed
CONFIG_READ_FAILED
path, reason
Failed to read configuration file
ConfigException.InvalidFormat
INVALID_CONFIG_FORMAT
jsonString, parseError, field
Invalid JSON format in configuration
JSON/Digest Errors
Error Type
Code
Properties
When It Occurs
SerializationException.InvalidJson
INVALID_JSON
jsonString, parseError, position
Invalid JSON parsing error
SerializationException.EncodeFailed
JSON_ENCODE_FAILED
element, reason
JSON encoding/serialization failed
TrustWeaveException.DigestFailed
DIGEST_FAILED
algorithm, reason
Digest computation failed
TrustWeaveException.EncodeFailed
ENCODE_FAILED
operation, reason
Encoding operation failed
Generic Errors
Error Type
Code
Properties
When It Occurs
ValidationFailed
VALIDATION_FAILED
field, reason, value
Input validation fails
InvalidOperation
INVALID_OPERATION
message, context, cause
Invalid operation attempted
InvalidState
INVALID_STATE
message, context, cause
Invalid state detected
NotFound
NOT_FOUND
resource, message, context, cause
Resource not found
Unknown
UNKNOWN_ERROR
message, context, cause
Unhandled exception
UnsupportedAlgorithm
UNSUPPORTED_ALGORITHM
algorithm, supportedAlgorithms
Algorithm not supported
Domain-Specific Errors
DID Errors
All DID errors are part of the DidException sealed class hierarchy (extends TrustWeaveException):
Error Type
Code
Properties
When It Occurs
Module
DidException.DidNotFound
DID_NOT_FOUND
did, availableMethods
DID resolution fails
did
DidException.DidMethodNotRegistered
DID_METHOD_NOT_REGISTERED
method, availableMethods
Using unregistered DID method
did
DidException.InvalidDidFormat
INVALID_DID_FORMAT
did, reason
DID format validation fails
did
DidException.DidResolutionFailed
DID_RESOLUTION_FAILED
did, reason, cause
DID resolution failed at runtime
did
DidException.DidCreationFailed
DID_CREATION_FAILED
did?, reason, cause
DID method failed to create
did
DidException.DidUpdateFailed
DID_UPDATE_FAILED
did, reason, cause
DID update failed
did
DidException.DidDeactivationFailed
DID_DEACTIVATION_FAILED
did, reason, cause
DID deactivation failed
did
DidException.RequiresAction
DID_REQUIRES_ACTION
did?, action, reason
Registrar returned an ACTION state
did
Credential Errors
There is noCredentialException class. Credential issuance and verification use sealed result types instead — see IssuanceResult and VerificationResult. Underlying KMS / DID failures may still throw KmsException / DidException during issuance.
Blockchain Errors
All blockchain errors are part of the BlockchainException sealed class hierarchy (extends TrustWeaveException):
importorg.trustweave.did.exception.DidExceptionimportorg.trustweave.core.exception.TrustWeaveExceptionimportorg.trustweave.trust.dsl.credential.DidMethods.KEYtry{valdid=trustWeave.createDid{method(KEY)}}catch(error:TrustWeaveException){when(error){isDidException.DidMethodNotRegistered->{println("Method not registered: ${error.method}")println("Available: ${error.availableMethods}")}isDidException.InvalidDidFormat->{println("Invalid DID format: ${error.reason}")}isDidException.DidNotFound->{println("DID not found: ${error.did}")}else->{println("Error: ${error.message}")}}}
Handling Credential Errors
Issuance returns IssuanceResult. Prefer when; use getOrThrow() only when you intentionally collapse failures to exceptions.
trustWeave.wallet { ... } returns a sealed WalletCreationResult — prefer when over try/catch. WalletException subtypes still appear when a lower-level wallet provider throws.
All exceptions have a code property that contains a string error code. Error codes are defined as string constants within each exception class. You can access the error code via the code property: