Daursu/postcode-lookup — pull request #1 by n00bsys0p (2013-09-19 11:34:03+00:00)
Title: Added exception handling and result checking

* Added exception and result handling to getCoordinates
* Added result checking - using the first is a mistake

Exception handler/rethrower on file_get_contents avoids having to handle generic 500
exceptions at a high level. The new exception, ServiceUnavailableException will be
rethrown on any error.

Result checking is also necessary, as the first result of the latitude/longitude search
is often incorrect for rural areas. It now loops through the results, trying to find one
that has a matching postal_code. If none is found, the library will return an empty array.