Pages

Showing posts with label exceptions. Show all posts
Showing posts with label exceptions. Show all posts

Friday, February 04, 2011

WIF - "Thread was being aborted" Error When SignIn / SignOut

If you ever try to implement WIF (code name Geneva), you probably found the error "Thread was being aborted" at the moment you try to execute the:

FederatedPassiveSecurityTokenServiceOperations.ProcessSignInResponse(responseMessage, response);
OR
FederatedPassiveSecurityTokenServiceOperations.ProcessSignOutRequest(requestMessage, User, requestMessage.Reply, Response);

This happens because in the middle of Windows.IdentityModel there's an Response.Redirect("returned page") instead of Response.Redirect("returned page", false) causing the error above mentioned. This is an known issue, and is save to ignore it. So, making use of a catch, you can jump the error and your code would be like...












You can skip this error and hoping for an hotfix soon :)


References:
http://p2p.wrox.com/asp-net-1-1/8403-error-thread-being-aborted.html
http://rmencia.wordpress.com/2010/05/05/federated-signin-requires-federated-signout/
http://social.msdn.microsoft.com/Forums/en/Geneva/thread/b248fafd-f5aa-47f7-9c7a-1ecaa944d2c0

Monday, January 31, 2011

Javascript - Catch Unhandled Exceptions

Have you ever thought to manage all exceptions at client side? if you use a simple line of code, like the one presented below, you can get an simple message and direct you to the right way to solve the script problem.










The window.onerror is an event handler for errors events sent to the window, catching all Unhandled Exceptions. But this approach has the problem that only works on IE or Gecko based browsers. It's a damn limitation for sure...

BTW, in order to test the onerror event, use a simple code line like "color[2]" without any initializing letting the script get error, then you'll see the alert window.



References:
https://developer.mozilla.org/En/DOM/Window.onerror
http://stackoverflow.com/questions/339580/does-javascript-fire-an-event-for-unhandled-uncaught-exceptions
http://stackoverflow.com/questions/1008692/window-onerror-not-firing-in-firefox