/**
 * A class that represents a DWN error.
 */
export class DwnError extends Error {
    constructor(code, message) {
        super(`${code}: ${message}`);
        this.code = code;
        this.name = 'DwnError';
    }
}
/**
 * DWN SDK error codes.
 */
export var DwnErrorCode;
(function (DwnErrorCode) {
    DwnErrorCode["AuthenticateJwsMissing"] = "AuthenticateJwsMissing";
    DwnErrorCode["AuthorizationMissing"] = "AuthorizationMissing";
    DwnErrorCode["AuthorizationUnknownAuthor"] = "AuthorizationUnknownAuthor";
    DwnErrorCode["GrantAuthorizationGrantExpired"] = "GrantAuthorizationGrantExpired";
    DwnErrorCode["GrantAuthorizationGrantMissing"] = "GrantAuthorizationGrantMissing";
    DwnErrorCode["GrantAuthorizationGrantRevoked"] = "GrantAuthorizationGrantRevoked";
    DwnErrorCode["GrantAuthorizationInterfaceMismatch"] = "GrantAuthorizationInterfaceMismatch";
    DwnErrorCode["GrantAuthorizationMethodMismatch"] = "GrantAuthorizationMethodMismatch";
    DwnErrorCode["GrantAuthorizationNotGrantedForTenant"] = "GrantAuthorizationNotGrantedForTenant";
    DwnErrorCode["GrantAuthorizationNotGrantedToAuthor"] = "GrantAuthorizationNotGrantedToAuthor";
    DwnErrorCode["GrantAuthorizationGrantNotYetActive"] = "GrantAuthorizationGrantNotYetActive";
    DwnErrorCode["HdKeyDerivationPathInvalid"] = "HdKeyDerivationPathInvalid";
    DwnErrorCode["PermissionsGrantGrantedByMismatch"] = "PermissionsGrantGrantedByMismatch";
    DwnErrorCode["PermissionsGrantUnauthorizedGrant"] = "PermissionsGrantUnauthorizedGrant";
    DwnErrorCode["PermissionsRevokeMissingPermissionsGrant"] = "PermissionsRevokeMissingPermissionsGrant";
    DwnErrorCode["PermissionsRevokeUnauthorizedRevoke"] = "PermissionsRevokeUnauthorizedRevoke";
    DwnErrorCode["ProtocolAuthorizationActionNotAllowed"] = "ProtocolAuthorizationActionNotAllowed";
    DwnErrorCode["ProtocolAuthorizationIncorrectDataFormat"] = "ProtocolAuthorizationIncorrectDataFormat";
    DwnErrorCode["ProtocolAuthorizationIncorrectProtocolPath"] = "ProtocolAuthorizationIncorrectProtocolPath";
    DwnErrorCode["ProtocolAuthorizationInvalidSchema"] = "ProtocolAuthorizationInvalidSchema";
    DwnErrorCode["ProtocolAuthorizationInvalidType"] = "ProtocolAuthorizationInvalidType";
    DwnErrorCode["ProtocolAuthorizationMissingRuleSet"] = "ProtocolAuthorizationMissingRuleSet";
    DwnErrorCode["ProtocolsConfigureUnauthorized"] = "ProtocolsConfigureUnauthorized";
    DwnErrorCode["RecordsDecryptNoMatchingKeyEncryptedFound"] = "RecordsDecryptNoMatchingKeyEncryptedFound";
    DwnErrorCode["RecordsDeriveLeafPrivateKeyUnSupportedCurve"] = "RecordsDeriveLeafPrivateKeyUnSupportedCurve";
    DwnErrorCode["RecordsDeriveLeafPublicKeyUnSupportedCurve"] = "RecordsDeriveLeafPublicKeyUnSupportedCurve";
    DwnErrorCode["RecordsInvalidAncestorKeyDerivationSegment"] = "RecordsInvalidAncestorKeyDerivationSegment";
    DwnErrorCode["RecordsProtocolsDerivationSchemeMissingProtocol"] = "RecordsProtocolsDerivationSchemeMissingProtocol";
    DwnErrorCode["RecordsSchemasDerivationSchemeMissingSchema"] = "RecordsSchemasDerivationSchemeMissingSchema";
    DwnErrorCode["RecordsWriteGetEntryIdUndefinedAuthor"] = "RecordsWriteGetEntryIdUndefinedAuthor";
    DwnErrorCode["RecordsWriteDataCidMismatch"] = "RecordsWriteDataCidMismatch";
    DwnErrorCode["RecordsWriteDataSizeMismatch"] = "RecordsWriteDataSizeMismatch";
    DwnErrorCode["RecordsWriteMissingData"] = "RecordsWriterMissingData";
    DwnErrorCode["RecordsWriteMissingDataStream"] = "RecordsWriteMissingDataStream";
    DwnErrorCode["RecordsWriteValidateIntegrityEncryptionCidMismatch"] = "RecordsWriteValidateIntegrityEncryptionCidMismatch";
    DwnErrorCode["Secp256k1KeyNotValid"] = "Secp256k1KeyNotValid";
    DwnErrorCode["UrlProtocolNotNormalized"] = "UrlProtocolNotNormalized";
    DwnErrorCode["UrlProtocolNotNormalizable"] = "UrlProtocolNotNormalizable";
    DwnErrorCode["UrlSchemaNotNormalized"] = "UrlSchemaNotNormalized";
    DwnErrorCode["UrlSchemaNotNormalizable"] = "UrlSchemaNotNormalizable";
})(DwnErrorCode || (DwnErrorCode = {}));
;
//# sourceMappingURL=dwn-error.js.map