Example usage for com.google.gwt.requestfactory.shared ServerFailure ServerFailure

List of usage examples for com.google.gwt.requestfactory.shared ServerFailure ServerFailure

Introduction

In this page you can find the example usage for com.google.gwt.requestfactory.shared ServerFailure ServerFailure.

Prototype

public ServerFailure(String message) 

Source Link

Document

Constructs a fatal ServerFailure with null type and null stack trace.

Usage

From source file:com.google.gwt.requestfactory.server.testing.InProcessRequestTransport.java

License:Apache License

public void send(String payload, TransportReceiver receiver) {
    String result;/*from w ww  .j  ava  2 s  .c o m*/
    try {
        if (DUMP_PAYLOAD) {
            System.out.println(">>> " + payload);
        }
        result = processor.process(payload);
        if (DUMP_PAYLOAD) {
            System.out.println("<<< " + result);
        }
    } catch (RuntimeException e) {
        e.printStackTrace();
        receiver.onTransportFailure(new ServerFailure(e.getMessage()));
        return;
    }
    receiver.onTransportSuccess(result);
}