forked from Mirrors/doipjs
Add parameter to catch blocks
This commit is contained in:
parent
996ee8fbc7
commit
6e828ca588
1 changed files with 3 additions and 3 deletions
|
@ -66,14 +66,14 @@ const verify = (signature, opts) => {
|
||||||
try {
|
try {
|
||||||
keyUri = sigKeys[0]
|
keyUri = sigKeys[0]
|
||||||
keyData = await keys.fetch.uri(keyUri)
|
keyData = await keys.fetch.uri(keyUri)
|
||||||
} catch {}
|
} catch(e) {}
|
||||||
}
|
}
|
||||||
// Try WKD
|
// Try WKD
|
||||||
if (!keyData && signersUserId) {
|
if (!keyData && signersUserId) {
|
||||||
try {
|
try {
|
||||||
keyUri = `wkd:${signersUserId}`
|
keyUri = `wkd:${signersUserId}`
|
||||||
keyData = await keys.fetch.uri(keyUri)
|
keyData = await keys.fetch.uri(keyUri)
|
||||||
} catch {}
|
} catch(e) {}
|
||||||
}
|
}
|
||||||
// Try HKP
|
// Try HKP
|
||||||
if (!keyData) {
|
if (!keyData) {
|
||||||
|
@ -81,7 +81,7 @@ const verify = (signature, opts) => {
|
||||||
const match = preferredKeyServer.match(/^(.*\:\/\/)?([^/]*)(?:\/)?$/i)
|
const match = preferredKeyServer.match(/^(.*\:\/\/)?([^/]*)(?:\/)?$/i)
|
||||||
keyUri = `hkp:${match[2]}:${issuerKeyId ? issuerKeyId : signersUserId}`
|
keyUri = `hkp:${match[2]}:${issuerKeyId ? issuerKeyId : signersUserId}`
|
||||||
keyData = await keys.fetch.uri(keyUri)
|
keyData = await keys.fetch.uri(keyUri)
|
||||||
} catch {
|
} catch(e) {
|
||||||
errors.push('key_not_found')
|
errors.push('key_not_found')
|
||||||
reject({ errors: errors })
|
reject({ errors: errors })
|
||||||
return
|
return
|
||||||
|
|
Loading…
Reference in a new issue