Error handling in ASP
I'm building a 3-tier solution using ASP and VB-COMs in MTS + SQL-Server.
When raising an error in the business tier (VB) the IIS/ASP cannot handle
it. When running the code in VB with a VB-form it works just fine, but using
ASP/IIS the CPU runs up to 100% and stays there until the MTS process is
killed. The ASP-page just times out.
This only happens with my own error raising. SQL-errors and other VB errors
Can anyone tell me what I'm doing wrong???
Re: Error handling in ASP
I don't know all the details of why this is so, but basically (as you're
discovering) you should never raise a user-defined error back to a page running
under IIS. This generally produces undesirable results, often to the point
of requiring the service to be stopped and restarted.
So, you're not doing anything wrong technically; it's just that you're misapplying
What are your options? It depends on how your function calls are built and
how much flexibility you have. One option would be to have a by reference
argument in all calls, and use it for error messages: if it has something,
it means there was an error; if not, success.
Another option is to build something a bit more elaborate (but more useful)
like an XML-based error string (either as a return value or a by reference
argument) that could hold as much error info as you want. For example (I'm
sure you could think of something better):
<Description>Primary Key Violation</Description>
<Message>Anything else the developer might find useful</Message>
Then you could have a routine (either in script or in another dll) that interprets
and handles these errors.
Hope that helps,
"Erik" <email@example.com> wrote:
>I'm building a 3-tier solution using ASP and VB-COMs in MTS + SQL-Server.
>When raising an error in the business tier (VB) the IIS/ASP cannot handle
>it. When running the code in VB with a VB-form it works just fine, but using
>ASP/IIS the CPU runs up to 100% and stays there until the MTS process is
>killed. The ASP-page just times out.
>This only happens with my own error raising. SQL-errors and other VB errors
>Can anyone tell me what I'm doing wrong???
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL