See Joel Program

February 5, 2008

JavaScript Error Publishing using ASP.NET AJAX

Filed under: AJAX, ASP.NET AJAX — Joel Rumerman @ 10:39 pm

Update: Source Code Stored Here

Let’s face it, as good of programmers that we think we are, we make mistakes. If we didn’t then all my email site would never be done for maintenance.

Now that we’ve set our egos aside, let’s talk about error handling. We’ve been handling errors on the server in a variety of ways for years. There are try/catch blocks, the generic error event at the application level, and other mechanisms for capturing and handling errors on the server. Only managing server errors was a generally accepted and okay concept as older applications used to be all about the server. However, as we continue to move more functionality to the client through JavaScript and the AJAX progamming pattern we’re shifting the balance of tasks from server-oriented to a client-oriented. By doing this we are creating more complex, dynamic applications that execute on the client,which is good for the end user, but as a result of this we have more errors occurring on the client. It just follows, the more complex code gets the more error-prone it becomes. It’s just an unfortunate fact of programming.

(more…)

February 4, 2008

A JavaScript Stack Trace in ASP.NET AJAX

Filed under: AJAX, ASP.NET AJAX — Tags: , , — Joel Rumerman @ 7:11 pm

Update: Source Code Located Here

Something came up in that work recently that I’ve found to be quite useful in my day to day coding sessions and that’s how to create a stack trace in ASP.NET AJAX.

For starters, JavaScript doesn’t provide an easy way of pulling the stack trace of the call so we’re going to have to roll our own.

I’ve seen a couple of different methods of creating the stack trace and the one I’m going to use comes from Helephant.com. I really like this implementation and I’m glad that I was able to poach somebody else’s code to create the stack trace (thx Helen!) rather than have to create mine from scratch.

(more…)

Blog at WordPress.com.