Hi Isomorphic,
We have set errorHandler for RPCManager in our main EntryPoint of appication:
Like this:
and we assume according to documentation that for all requests where with setWillHandleError(false) and negative response status this callback will be called.
But could you please clarify situation when status is Validation Error?(-4). Should this callback also called for response with status -4?
I am asking because in java doc (http://www.smartclient.com/smartgwte...rHandling.html) it is written "Validation errors are treated differently from other errors, precisely because they are an expected part of the normal operation of the system"
and also "The remainder of this article concerns unrecoverable errors. These are errors with the system itself, for example:
A network transport problem
A server-side crash
An update failed because a transaction was rolled back
Errors like this can either be handled centrally, or you can choose to handle them in your regular callback code. DSRequest calls default to centralized handling; RPCRequest calls default to user error handling in the callback"
We have a case when we send dsRequest via queue where dmi method is called inside and from this dmi method we receive dsResponse with status -4:
This is the similar code which we have and as a result we see that HandleErrorCallback is called also:
and inside DMI we have
We use SmartClient Version: v10.0p_2017-01-18/PowerEdition Deployment (built 2017-01-18).
Browser version FF 26.
We have set errorHandler for RPCManager in our main EntryPoint of appication:
Like this:
Code:
@Override public void onModuleLoad() { RPCManager.setHandleErrorCallback(new HandleErrorCallback() { @Override public void handleError(DSResponse response, DSRequest request) { SC.warn("Error"); } } }
But could you please clarify situation when status is Validation Error?(-4). Should this callback also called for response with status -4?
I am asking because in java doc (http://www.smartclient.com/smartgwte...rHandling.html) it is written "Validation errors are treated differently from other errors, precisely because they are an expected part of the normal operation of the system"
and also "The remainder of this article concerns unrecoverable errors. These are errors with the system itself, for example:
A network transport problem
A server-side crash
An update failed because a transaction was rolled back
Errors like this can either be handled centrally, or you can choose to handle them in your regular callback code. DSRequest calls default to centralized handling; RPCRequest calls default to user error handling in the callback"
We have a case when we send dsRequest via queue where dmi method is called inside and from this dmi method we receive dsResponse with status -4:
This is the similar code which we have and as a result we see that HandleErrorCallback is called also:
Code:
final boolean wasQueuing = RPCManager.startQueue(); DSRequest dsRequest = new DSRequest(DSOperationType.ADD, new Record()); dsRequest.setWillHandleError(false); dsRequest.setOperationId("addCustom"); dataSource.execute(dsRequest); DSRequest dsRequest2 = new DSRequest(DSOperationType.ADD, new Record()); dsRequest2.setWillHandleError(false); dsRequest2.setOperationId("addCustom"); dataSource.execute(dsRequest2); final RPCQueueCallback validateCallback = new RPCQueueCallback() { @Override public void execute(RPCResponse... rpcResponses) { SC.warn("Validation Error"); } }; if (!wasQueuing) { RPCManager.sendQueue(validateCallback); } } });
Code:
public DSResponse addCustom(DSRequest dsRequest) throws Exception { log.info("procesing DMI ADD operation"); DSResponse dsResponse = new DSResponse(); dsResponse.setStatus(DSResponse.STATUS_VALIDATION_ERROR); return dsResponse; }
Browser version FF 26.
Comment