update error msg
This commit is contained in:
parent
747f406107
commit
8d85bbaadf
@ -336,11 +336,11 @@ EC.exportSync = function (opts) {
|
|||||||
if (!format || 'sec1' === format) {
|
if (!format || 'sec1' === format) {
|
||||||
format = 'sec1';
|
format = 'sec1';
|
||||||
} else if ('pkcs8' !== format) {
|
} else if ('pkcs8' !== format) {
|
||||||
throw new Error("options.format must be 'sec1' or 'pkcs8' for private EC keys");
|
throw new Error("options.format must be 'sec1' or 'pkcs8' for private EC keys, not '" + format + "'");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (-1 === [ 'P-256', 'P-384' ].indexOf(jwk.crv)) {
|
if (-1 === [ 'P-256', 'P-384' ].indexOf(jwk.crv)) {
|
||||||
throw new Error("options.jwk.crv must be either P-256 or P-384 for EC keys");
|
throw new Error("options.jwk.crv must be either P-256 or P-384 for EC keys, not '" + jwk.crv + "'");
|
||||||
}
|
}
|
||||||
if (!jwk.y) {
|
if (!jwk.y) {
|
||||||
throw new Error("options.jwk.y must be a urlsafe base64-encoded either P-256 or P-384");
|
throw new Error("options.jwk.y must be a urlsafe base64-encoded either P-256 or P-384");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user