"use strict";
var __extends = (this && this.__extends) || (function () {
    var extendStatics = function (d, b) {
        extendStatics = Object.setPrototypeOf ||
            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
            function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
        return extendStatics(d, b);
    };
    return function (d, b) {
        if (typeof b !== "function" && b !== null)
            throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };
})();
Object.defineProperty(exports, "__esModule", { value: true });
exports.DwnErrorCode = exports.DwnError = void 0;
/**
 * A class that represents a DWN error.
 */
var DwnError = /** @class */ (function (_super) {
    __extends(DwnError, _super);
    function DwnError(code, message) {
        var _this = _super.call(this, "".concat(code, ": ").concat(message)) || this;
        _this.code = code;
        _this.name = 'DwnError';
        return _this;
    }
    return DwnError;
}(Error));
exports.DwnError = DwnError;
/**
 * DWN SDK error codes.
 */
var DwnErrorCode;
(function (DwnErrorCode) {
    DwnErrorCode["AuthenticateJwsMissing"] = "AuthenticateJwsMissing";
    DwnErrorCode["AuthorizationMissing"] = "AuthorizationMissing";
    DwnErrorCode["AuthorizationUnknownAuthor"] = "AuthorizationUnknownAuthor";
    DwnErrorCode["HdKeyDerivationPathInvalid"] = "HdKeyDerivationPathInvalid";
    DwnErrorCode["ProtocolAuthorizationActionNotAllowed"] = "ProtocolAuthorizationActionNotAllowed";
    DwnErrorCode["ProtocolAuthorizationIncorrectDataFormat"] = "ProtocolAuthorizationIncorrectDataFormat";
    DwnErrorCode["ProtocolAuthorizationIncorrectProtocolPath"] = "ProtocolAuthorizationIncorrectProtocolPath";
    DwnErrorCode["ProtocolAuthorizationInvalidSchema"] = "ProtocolAuthorizationInvalidSchema";
    DwnErrorCode["ProtocolAuthorizationInvalidType"] = "ProtocolAuthorizationInvalidType";
    DwnErrorCode["ProtocolAuthorizationMissingRuleSet"] = "ProtocolAuthorizationMissingRuleSet";
    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 = exports.DwnErrorCode || (exports.DwnErrorCode = {}));
;
//# sourceMappingURL=dwn-error.js.map