J
jts-law
Guest
Hi All, The backend to my KUIB app is a REST (WEB transport) service (Progress 11.7.1). As part of the backend I have an event handler class that subscribes to the DataObjectHandler:Invoking events. The Invoking handler is used to do some pre-processing before performing the actual REST requests. My issue is that I can't figure out how to gracefully generate an error within the Invoking handler and return it to the client without continuing to process the request. I received the example below to get started with my Invoking handler. From this example it appears that I should be able to set poEventArgs:Cancel, but this isn't working. I can't find any documentation on the Cancel property, and when the Cancel property is set, the request just continues on processing. Generating a new AppError stops the request processing, but it doesn't return the error message back to the client. What I would like to do is cancel the request and return an error message(s) in the response, and then have my KUIB app display the error(s). /* Event published before the business logic function is called by the handler @param Progress.Lang.Object The handler publishing the event @param OperationInvocationEventArgs Event args for this event */ method public void InvokingHandler (input poSender as Progress.Lang.Object, input poEventArgs as OperationInvocationEventArgs): define variable httpHeader as HttpHeader no-undo. httpHeader = poEventArgs:Request:GetHeader('SOMEHEADERVALUE'). if httpHeader:Value eq 'go-away' then poEventArgs:Cancel = true . if httpHeader:Value eq 'whoops' then poEventArgs:Error = new AppError('Error with credentials', 0). end method. Louis
Continue reading...
Continue reading...