Skip to content

Return Structured JSON Errors with Reason as a key #261

@BornPsych

Description

@BornPsych

throw new Error(`DKIM signature verification failed for domain ${signingDomain}. Reason: ${comment}`);

Currently, errors are returned as plain strings, which makes it harder to programmatically handle and segregate them in downstream applications.

throw new Error(JSON.stringify({
   message: `DKIM signature verification failed for domain ${signingDomain}.`,
  reason:  `${comment}`
}));

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions