pablo-co / bamboo_postmark

A Bamboo adapter for Postmark
MIT License
39 stars 29 forks source link

deliver/2 shouldn't throw exceptions #20

Closed chingan-tsc closed 5 years ago

chingan-tsc commented 6 years ago

Hi, this may sound opinionated but IMHO I think the return of deliver/2 is inconsistent as I believe its a convention to append a ! (bang) to the routines that'll raise an exception. In other words, do you its sane to change the current deliver/2 to deliver!/2 and add another deliver/2 that'll return {:ok, %{status_code: status, headers: headers, body: response}} or {:error, :api_error}.

I understand that'll require change on the Bamboo codebase as well but what do you think?

P/S: I can help in submitting the PR should you agree to make the change.

pablo-co commented 6 years ago

I actually agree with you, it is indeed a convention to add a bang for functions that raise exceptions. You should raise this concern in the bamboo repo since they decide what the interface for adapters is.

pablo-co commented 5 years ago

Will reopen this issue when bamboo addresses this!