Revision 6c372d22
b/src/gr/grnet/pithos/web/client/rest/RestRequestCallback.java | ||
---|---|---|
60 | 60 |
try { |
61 | 61 |
if (response.getStatusCode() == HTTP_OK || (okcode !=-1 && response.getStatusCode() == okcode)) |
62 | 62 |
onSuccess(deserialize(response)); |
63 |
else if (response.getStatusCode() == Response.SC_UNAUTHORIZED) |
|
63 |
else if (response.getStatusCode() == Response.SC_UNAUTHORIZED) { |
|
64 |
log(request, response); |
|
64 | 65 |
onUnauthorized(response); |
66 |
} |
|
65 | 67 |
else { |
66 | 68 |
String statusText = ""; |
67 | 69 |
String text = ""; |
... | ... | |
83 | 85 |
} |
84 | 86 |
} |
85 | 87 |
|
88 |
private native void log(Request req, Response resp)/*-{ |
|
89 |
if ($wnd.console && $wnd.console.log) { |
|
90 |
$wnd.console.log(req.@com.google.gwt.http.client.Request::toString()()); |
|
91 |
$wnd.console.log(resp.@com.google.gwt.http.client.Response::toString()()); |
|
92 |
$wnd.console.log(resp.@com.google.gwt.http.client.Response::getStatusCode()()); |
|
93 |
$wnd.console.log(resp.@com.google.gwt.http.client.Response::getStatusText()()); |
|
94 |
$wnd.console.log(resp.@com.google.gwt.http.client.Response::getStatusCode()()); |
|
95 |
$wnd.console.log(resp.@com.google.gwt.http.client.Response::getText()()); |
|
96 |
$wnd.console.log(resp.@com.google.gwt.http.client.Response::getHeadersAsString()()); |
|
97 |
} |
|
98 |
}-*/; |
|
99 |
|
|
86 | 100 |
public abstract void onSuccess(T result); |
87 | 101 |
|
88 | 102 |
public abstract T deserialize(Response response); |
Also available in: Unified diff