Skip to content

Commit

Permalink
fix: catch edge case and bubble up detailed error rejection for traci…
Browse files Browse the repository at this point in the history
…ng core issue
  • Loading branch information
niftylettuce committed Aug 13, 2020
1 parent 72ff552 commit 1c5fc6f
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,17 @@ function authenticateMessage(message, ...args) {
const result = {
header: stdout.join('').trim().split('Authentication-Results: ')[1]
};

// TODO: investigate thie edge case further and follow up with authheaders/dkimpy authors
if (!result.header)
return reject(
new Error(
`No Authentication-Results header was returned. Data: ${JSON.stringify(
{ message, stdout, stderr }
)}`
)
);

for (const key of KEYS) {
result[key] = {};
}
Expand Down

0 comments on commit 1c5fc6f

Please sign in to comment.