maxmind/geoip-api-php — pull request #28 by wedi (2014-11-11 11:53:21+00:00)
Title: Remove die calls, add source description to error messages.

Hi!

This pull request replaces all calls to `die()` with `trigger_error()` in the API functions.

IMO it’s not a good idea for an API to call `die()` as it’s catchable only via the ugly `register_shutdown_function()` which one cannot remove after the GeoIP API call. This change allows devs to gracefully handle these errors (by setting `set_error_handler`) instead of hard breaking all functionality. Let the dev instead of the API decide whether to hard break an app/website/…, to ignore the error or to show a neat message.

Additionally I’ve added a source description in front of the error messages to easier locate error messages reported by end users.

Thanks!