View Javadoc
1   /*
2    * Copyright (c) MuleSoft, Inc.  All rights reserved.  http://www.mulesoft.com
3    * The software in this package is published under the terms of the CPAL v1.0
4    * license, a copy of which has been included with this distribution in the
5    * LICENSE.txt file.
6    */
7   package org.mule.transport.http;
8   
9   /**
10   * A wrapper exceptin for any http client return codes over the 400 range
11   */
12  public class HttpResponseException extends Exception
13  {
14      private String responseText;
15      private int responseCode;
16  
17      public HttpResponseException(String responseText, int responseCode)
18      {
19          super(responseText + ", code: " + responseCode);
20          this.responseCode = responseCode;
21          this.responseText = responseText;
22      }
23  
24      public String getResponseText()
25      {
26          return responseText;
27      }
28  
29      public int getResponseCode()
30      {
31          return responseCode;
32      }
33  }