node-ses
node-ses copied to clipboard
Use Error instance for better integration
When amazon returns an error, an object is used as error
Which is the benefit of this approach ?
Are you comparing the current approach returning strings or returning Error objects?
I'm concerned about the Object usage instead of Error.
Particularly when the Error interface is lost
The used property Message is not compliant with the javascript world.
The error handling will be a nightmare.
I agree that returning an Error object instead of plain object could be helpful.
The properties Type, Code and Message were chosen for consistency with the other responses that Amazon provides.
You are welcome to propose the specifics of an alternate approach. If it's not backwards-compatible, impact on existing code bases using node-ses should be considered.
The official AWS JavaScript SDK and node-mailer may be useful references.