Added HTTP error exception handling