title: Exception Handling In Android from Web API
body: <p>My code in MVC API C# this:</p>
  
  <pre><code>    [System.Web.Http.HttpPost]
      [System.Web.Http.Route("api/ServiceV1/Test")]
      public IHttpActionResult Test()
      {
          return BadRequest("Catch this message in Android application");
      }
  </code></pre>
  
  <p>Result in PostMan </p>
  
  <pre><code>{
      "Message": "Catch this message in Android application"
  }
  </code></pre>
  
  <p>I catch this error message on android application. I used okhttp3.</p>
  
  <pre><code>    String MIME_JSON = "application/json";
      Gson gson = new Gson();
      RequestBody body = RequestBody.create(MediaType.parse(MIME_JSON), gson.toJson(object));
  
      Request request = new Request.Builder()
              .url(baseUrl + route)
              .post(body)
              .build();
  
      okHttpClient.newCall(request).execute();
  </code></pre>
  
  <p>How do to catch this message on the Android application?</p>