[Progress Communities] [Progress OpenEdge ABL] Forum Post: New to working with DOH

Status
Not open for further replies.
B

Blake Stanford

Guest
I'm new to working the Dynamic Object Handler, using the Spark framework. My question is how can I pretty up an error being thrown from with in the application, in this case from the InvokingHandler event? One class into the InvokingHandler, from ::establishRequestEnvionment, (the first statement:UNDO, THROW NEW Progress.Lang.AppError("My Test error.", 0) ), I throw an Progress.Lang.App error which is caught by the InvokingHandler catch block. A generic 500 error gets returned to the client. I want to be able to pretty up the error message and give more detail, but I cannot seem to find from where that error message is being generated. I've traced calls back into the OpenEdge.Web.DataObject.DataObjectHandler but get lost from there. Any help would be appreciate. { "error_code": 500, "status_txt": "500 - Server Error: the server could not produce a response entity due to an internal error - GET /myapp/web/api/printers/printers/fetchprinters", "error_details": { "remote_user": "null", "user_principal": "null", "url_scheme": "http", "remote_addr": "0:0:0:0:0:0:0:1", "server_name": "localhost", "product_type": "dev", "http_status": 500, "error_detail": "" }, "debug_details": { "http_method": "GET", "web_application": "/myapp", "transport": "OEWebServlet", "request_url": "/myapp/web/api/printers/printers/fetchprinters", "path_info": "null", "servlet": "OEWebServlet", "uri": "/myapp/web/api/printers/printers/fetchprinters", "exception_class": "", "exception_message": "", "exception_stack_trace": "" } } The InvokingHandler code: method private void InvokingHandler ( input poSender as Progress.Lang.Object, input poEventArgs as OperationInvocationEventArgs ): assign dInvokeTime = now. /* Remember when we start execution. */ /* Determine the target type of the entity. */ define variable oTargetType as TargetTypeEnum no-undo. assign oTargetType = TargetTypeEnum:GetEnum(poEventArgs:Operation:TargetType). if poEventArgs:Operation:ServiceURI eq "/" then oLogger:Debug(substitute("INVOKING - &1 '&2' [&3]", string(poEventArgs:Operation:Method), poEventArgs:Service:Name, poEventArgs:Operation:TargetName)). if oTargetType eq TargetTypeEnum:procedure then oLogger:Debug(substitute("INVOKING - &1 /&2 &3 -> '&4' in &5", string(poEventArgs:Operation:Method), poEventArgs:Service:Name, poEventArgs:Operation:ServiceURI, poEventArgs:Operation:TargetFunction, poEventArgs:Operation:TargetName)). else oLogger:Debug(substitute("INVOKING - &1 /&2/&3 -> &4:&5", string(poEventArgs:Operation:Method), poEventArgs:Service:Name, poEventArgs:Operation:ServiceURI, poEventArgs:Operation:TargetName, poEventArgs:Operation:TargetFunction)). /** * Assert the current user's identity for this session request. * * Note: For working with anonymous security, ensure the following are set: * OEClientPrincipalFilter.anonymous=true * OEClientPrincipalFilter.sealAnonymous=true * OEClientPrincipalFilter.passthru=true */ assign oPrincipal = OpenEdge.Security.Principal:Import(session:current-request-info). Ccs.Common.Application:SessionManager:establishRequestEnvironment(oPrincipal:Token). catch err as Progress.Lang.Error: assign poEventArgs:Error = err. oLogger:Error(substitute("INVOKING - &1: &2", poEventArgs:Operation:TargetName, err:GetMessage(1))). end catch. end method. /* InvokingHandler */

Continue reading...
 
Status
Not open for further replies.
Top