Add helper methods for HTTP error detection.