Announcement

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

    Handling Errors in DMI RCP Calls

    I have a DMI RPC setup and working.

    I plan on allowing the callback specified in the DMI.call handle any errors based on the status field value.

    I read that I need to disable the default error handling in the RPCManager documentation, but I cannot figure out how/where to make the call to specify that I want to handle errors myself. There is no RPCRequest in the DMI.call or I would set it there.

    Thanks in advance for any help on this.

    #2
    The fact that you can't pass an RPCRequest to the current DMI APIs is a known limitation that is scheduled to be addressed (no ETA).

    You can instead add an RPCManager error handler to override default error handling to specially deal with errors from this particular DMI. However first consider the entirely different approach of a DataSource operation of type "custom" (see DataSource.performCustomOperation()). This is generally easier, as non-DataSource operations are usually related in some way to a DataSource and it avoids having a separate .app.xml file around.

    Comment


      #3
      Great information. Thank you.

      I will try the first part of your response out now since we have it implemented this way and plan to look into the second part as a refactoring.

      I am looking over the RPCManager documentation now. Could you point me in the right direction for overriding the RPCManager's error handling? Is there a way I can just have it return a status back to the client's callback specified in the DMI.call?

      Comment


        #4
        Again without the ability to pass an RPCRequest to DMI.call(), you can't signal that you want your normal callback to be called even if there's an error. So if you want the callback to be called, you would have to signal there was no error (set status 0) and return some other flag within the response data that would indicate an error.

        As far as doing this via overriding central error handling instead, the API is setHandleErrorCallback.

        Comment

        Working...
        X