LEFT | RIGHT |
1 // Copyright 2011 Google Inc. All Rights Reserved. | 1 // Copyright 2011 Google Inc. All Rights Reserved. |
2 | 2 |
3 package com.google.api.client.sample.bigquery.appengine.dashboard; | 3 package com.google.api.client.sample.bigquery.appengine.dashboard; |
4 | 4 |
5 import org.apache.http.client.HttpResponseException; | 5 import org.apache.http.client.HttpResponseException; |
6 | 6 |
7 import javax.servlet.http.HttpServletResponse; | 7 import javax.servlet.http.HttpServletResponse; |
8 | 8 |
9 /** | 9 /** |
10 * Exception to wrap an arbitrary exception as a HttpResponseException. | 10 * Exception to wrap an arbitrary exception as a HttpResponseException. |
(...skipping 23 matching lines...) Expand all Loading... |
34 private static int getStatusFromException(Exception ex) { | 34 private static int getStatusFromException(Exception ex) { |
35 if (ex instanceof com.google.api.client.http.HttpResponseException) { | 35 if (ex instanceof com.google.api.client.http.HttpResponseException) { |
36 com.google.api.client.http.HttpResponseException hrex = | 36 com.google.api.client.http.HttpResponseException hrex = |
37 (com.google.api.client.http.HttpResponseException) ex; | 37 (com.google.api.client.http.HttpResponseException) ex; |
38 return hrex.getResponse().getStatusCode(); | 38 return hrex.getResponse().getStatusCode(); |
39 } else { | 39 } else { |
40 return HttpServletResponse.SC_INTERNAL_SERVER_ERROR; | 40 return HttpServletResponse.SC_INTERNAL_SERVER_ERROR; |
41 } | 41 } |
42 } | 42 } |
43 } | 43 } |
LEFT | RIGHT |