Showing results for 
Search instead for 
Do you mean 
Community Home Request Access Read Blogs Share Your Ideas Search Community View My Settings
Reply
Copper Super Contributor
Posts: 172
Registered: ‎07-06-2010

Extending Exception Handling for Slx Client

[ Edited ]

We have been working on extending some of the exception handling in the web client to store and persist some additional information.

 

And while we have been successful in extending Global.cs to add code to the Application_Error event, I can't figure out the best way to extend Page Error exceptions. These seem to be handled by the ErrorHelper class but my guess is its being done in the EntityPage class (which I don't have access to), because these exceptions do have SLX Exception IDs and they are logged to the Event Viewer.

 

In cases where, for example, there is a misspelling of a field binding:

 

 Sage.Platform.WebPortal.Binding.WebEntityBinding pklSubTypePickListValueBinding = new Sage.Platform.WebPortal.Binding.WebEntityBinding("SubType", pklSubType, "PickListValue");

BindingSource.Bindings.Add(pklSubTypePickListggggValueBinding); // oops! Exception is thrown here

 

This isn't trapped in Application Error (at least my breakpoint and custom exception code isnt run), and in the above scenario the user doesn't even see an Exception ID (they just see the "We're sorry, you've encountered an error. If applicable, please try again") error in the browser. I added this on purpose in AccountDetails in an effort to test how exceptions are handled; this is the only thing shown in the Details pane (along with all the groups and other navigation elements surrounding it).

 

How can we tap into this to include additional customized exception handling code?

 

I've tried setting breakpoints on _scriptManager_AsyncPostBackError to see if that's where it breaks, but that doesn't seem to be the right place.

 

Employee
Posts: 629
Registered: ‎04-24-2009

Re: Extending Exception Handling for Slx Client

[ Edited ]

There are three primary locations where the Sage.Platform.Diagnostics.ErrorHelper handles exceptions:

 

1. Sage.Platform.Application.UI.Web.ApplicationPage: protected void HandleException(Exception ex).

2. Model\Portal\Templates\DefaultCSharpCodeBehind.vm: void _scriptManager_AsyncPostBackError(object sender, AsyncPostBackErrorEventArgs e). This is where asyn postback errors are handled. The error information is passed to jscript\Sage\Utility\ErrorHandler.js. Note that appSettings.config has a large number of configuration options that determine how Ajax errors are handled.

3. Global.cs: Application_Error.

 

I suspect the location you're after is the protected HandleException() method in Sage.Platform.Application.UI.Web.ApplicationPage.

 

Note that you could create an HttpModule that intercepted exceptions as they occur.

 

Thanks

 

Mike