Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    adding Object rawData to HandleErrorCallback interface

    Hello,

    In SGWT Power 3.0p (and probably other versions),

    the following interface exists to handle severe errors from the server in the client:
    Code:
    public interface HandleErrorCallback {
    
        /**
         * RPCManager error handler callback.
         *
         * @param response the response
         * @param request the request
         *
         * @see RPCManager#setHandleErrorCallback
         */
        void handleError(DSResponse response, DSRequest request);
    
    }
    However, when something really bad happens, like an SQL error on the server in custom DMI, it can be that the response.getData() function will trip, because it actually is a String that is returned rather than the expected 'Record'.

    In the case of setWillHandleError(true), in the DSCallback, we have the Object rawData parameter.

    The question I have is: Can this parameter be retrieved from response, or added to this interface? I could use this for some diagnostics purposes, like sending an email when something like this happens, allowing me to detect this stuff quicker than keeping an eye on the logs.

    Of course, this could be done on the server as well, but it would still be nice if response.getData() wouldn't trip. :-)

    #2
    For this kind of very fundamental error (request completely malformed) use the handleTransportError() handler - there you get the raw response text and HTTP status as parameters.

    Also, with this API you are handling a flaw in the entire HTTP response, which could contain multiple dsResponse, so enhancing handleError would not really make sense.

    Comment

    Working...
    X