Catch and re-throw requests and response encode/decode errors in HttpRequest.encode()/HttpResponse.decode()