drewm / mailchimp-api

Super-simple, minimum abstraction MailChimp API v3 wrapper, in PHP
MIT License
1.99k stars 506 forks source link

MailChimp error handler #283

Open drzraf opened 5 years ago

drzraf commented 5 years ago

This is a handy & opt-in error-handler.

Based on my past MailChimp experiences I found there are many ways a MailChimp request can fail, and many try rightfully to handle them over and over again.

This error handler classifies a couple of failures and should help programmers to simplify their own error-handling routines. Since, 99% error-handlers also implement some logging alongside (which can hardly be extracted out of the error-handling itself), some logging capability are provided (and try to play nice with user not providing a \Psr\Log\LoggerInterface).

PR related to errors: #165, #236, #239, #275