aboutsummaryrefslogtreecommitdiff
path: root/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/lib/errors.js
diff options
context:
space:
mode:
Diffstat (limited to 'deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/lib/errors.js')
-rw-r--r--deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/lib/errors.js28
1 files changed, 27 insertions, 1 deletions
diff --git a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/lib/errors.js b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/lib/errors.js
index 3551c1071e..1cc09ec71d 100644
--- a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/lib/errors.js
+++ b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/lib/errors.js
@@ -50,9 +50,35 @@ function SignatureParseError(type, format, innerErr) {
}
util.inherits(SignatureParseError, Error);
+function CertificateParseError(name, format, innerErr) {
+ if (Error.captureStackTrace)
+ Error.captureStackTrace(this, CertificateParseError);
+ this.name = 'CertificateParseError';
+ this.format = format;
+ this.certName = name;
+ this.innerErr = innerErr;
+ this.message = 'Failed to parse ' + name + ' as a valid ' + format +
+ ' format certificate: ' + innerErr.message;
+}
+util.inherits(CertificateParseError, Error);
+
+function KeyEncryptedError(name, format) {
+ if (Error.captureStackTrace)
+ Error.captureStackTrace(this, KeyEncryptedError);
+ this.name = 'KeyEncryptedError';
+ this.format = format;
+ this.keyName = name;
+ this.message = 'The ' + format + ' format key ' + name + ' is ' +
+ 'encrypted (password-protected), and no passphrase was ' +
+ 'provided in `options`';
+}
+util.inherits(KeyEncryptedError, Error);
+
module.exports = {
FingerprintFormatError: FingerprintFormatError,
InvalidAlgorithmError: InvalidAlgorithmError,
KeyParseError: KeyParseError,
- SignatureParseError: SignatureParseError
+ SignatureParseError: SignatureParseError,
+ KeyEncryptedError: KeyEncryptedError,
+ CertificateParseError: CertificateParseError
};