DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2
  1. #1
    Erik Guest

    Error handling in ASP


    Hi!
    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
    returns OK.

    Can anyone tell me what I'm doing wrong???

  2. #2
    Paul Klanderud Guest

    Re: Error handling in ASP


    Erik:

    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
    it.

    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):

    <Error ID="123454">
    <Routine>CProcessData.InsertCustomer</Routine>
    <Description>Primary Key Violation</Description>
    <Message>Anything else the developer might find useful</Message>
    <DateTime>12/07/00 10:00:32</DateTime>
    </Error>

    Then you could have a routine (either in script or in another dll) that interprets
    and handles these errors.

    Hope that helps,
    Paul Klanderud

    "Erik" <erple@hotmail.com> wrote:
    >
    >Hi!
    >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
    >returns OK.
    >
    >Can anyone tell me what I'm doing wrong???



Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


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


Sponsored Links