[iso-core] Provide better info to Sentry on send errors

Summary:
In many cases when send fails, the server settings may be incorrect.
Send this data to Sentry with the original error in order to help us
diagnose.

I think the grouping will only contain settings for a single user
getting the same error, but should still be good enough to do further
investigation, e.g. https://sentry.io/nylas/nylas-mail/issues/230529222/

We can always go look up the requests in the n1Cloud logs if more info is
needed.

Test Plan: yolo

Reviewers: mark, juan

Reviewed By: juan

Differential Revision: https://phab.nylas.com/D4131
This commit is contained in:
Christine Spang 2017-03-07 17:08:21 -08:00
parent 4fd1f3e97d
commit bec943e1e3

View file

@ -61,7 +61,13 @@ class SendmailClient {
throw new APIError('Sending failed - Network Error', 401, {originalError: error})
}
throw new APIError('Sending failed', 500, {originalError: error});
const {host, port, secure} = this._transporter.options;
throw new APIError('Sending failed', 500, {
originalError: error,
smtp_host: host,
smtp_port: port,
smtp_use_ssl: secure,
});
}
_getSendPayload(message) {