Example usage for com.google.gwt.http.client Response SC_NOT_IMPLEMENTED

List of usage examples for com.google.gwt.http.client Response SC_NOT_IMPLEMENTED

Introduction

In this page you can find the example usage for com.google.gwt.http.client Response SC_NOT_IMPLEMENTED.

Prototype

int SC_NOT_IMPLEMENTED

To view the source code for com.google.gwt.http.client Response SC_NOT_IMPLEMENTED.

Click Source Link

Usage

From source file:com.google.collide.client.communication.FrontendRestApi.java

License:Open Source License

private static FailureReason getFailureReason(Response response, ServerError responseData) {
    switch (response.getStatusCode()) {
    case Response.SC_OK:
        return null;
    case Response.SC_UNAUTHORIZED:
        if (responseData != null) {
            return responseData.getFailureReason();
        }//from  w  ww  . j a v a 2s . c o  m
        return FailureReason.UNAUTHORIZED;
    // TODO: Make this a server dto error.
    case Response.SC_CONFLICT:
        return FailureReason.STALE_CLIENT;
    case Response.SC_NOT_FOUND:
        if (responseData != null) {
            return responseData.getFailureReason();
        }
        return FailureReason.UNKNOWN;
    case Response.SC_NOT_IMPLEMENTED:
        if (responseData != null) {
            return responseData.getFailureReason();
        }
        return FailureReason.UNKNOWN;
    default:
        return FailureReason.SERVER_ERROR;
    }
}