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.
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 */
catch err as Progress.Lang.Error:
assign poEventArgs:Error = err.
oLogger:Error(substitute("INVOKING - &1: &2", poEventArgs:Operation:TargetName, err:GetMessage(1))).
end catch.
Sorry, I didn't specify the version, it's 11.7.5
No, re-throwing the error results in the same message.