Comparing version 4.3.0 to 4.3.1
@@ -303,4 +303,10 @@ 'use strict'; | ||
let policyId; | ||
try { | ||
let policyId = await resolvePolicy(domain, opts); | ||
policyId = await resolvePolicy(domain, opts); | ||
} catch (err) { | ||
return { policy: { id: false, mode: 'none', error: err }, status: 'errored' }; | ||
} | ||
try { | ||
if (!policyId) { | ||
@@ -339,3 +345,13 @@ return { policy: { id: false, mode: 'none' }, status: 'not_found' }; | ||
} | ||
throw err; | ||
// prevent loading the policy for the next 1 hour and default to "none" | ||
return { | ||
policy: { | ||
id: policyId, | ||
mode: 'none', | ||
expires: new Date(Date.now() + 1 * 3600 * 1000).toISOString(), | ||
error: err | ||
}, | ||
status: 'errored' | ||
}; | ||
} | ||
@@ -342,0 +358,0 @@ }; |
{ | ||
"name": "mailauth", | ||
"version": "4.3.0", | ||
"version": "4.3.1", | ||
"description": "Email authentication library for Node.js", | ||
@@ -5,0 +5,0 @@ "main": "lib/mailauth.js", |
266792
5170