Handle HTTP error to avoid throwing exceptions 

Otherwise it would crash the application.