improved HTTP exceptions handling