Catch PHP error to thrown easier catchable exceptions
Follow alb coding style
Add test for bad http requests
Merge pull request #2 from tzi/pr__catch-error

Catch PHP error to thrown easier catchable exceptions