Handle HTTP exceptions