• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 161
  • Last Modified:

Need to get my exception handler running on my web service.

I'm having a hard time getting my web service to write to a text file upon start-up.  I am getting an exception which I am trying to get a handle on, but first I need to get my exception handler working.

I called my ISP and found the path to the root directory on my website and use it when defining the filename to write a sample textfile to.  But it never gets created.

Any ideas?
0
newbieweb
Asked:
newbieweb
  • 4
  • 4
1 Solution
 
surajgupthaCommented:
If you wanted to see the actual exception, just switch off custom exceptions in ur web.config file, that way you would see the reason the file isnt created.
0
 
newbiewebAuthor Commented:
sounds interesting.  How do I turn it off?
0
 
newbiewebAuthor Commented:
what shall I change?

        <!--
            The <customErrors> section enables configuration
            of what to do if/when an unhandled error occurs
            during the execution of a request. Specifically,
            it enables developers to configure html error pages
            to be displayed in place of a error stack trace.

        <customErrors mode="RemoteOnly" defaultRedirect="GenericErrorPage.htm">
            <error statusCode="403" redirect="NoAccess.htm" />
            <error statusCode="404" redirect="FileNotFound.htm" />
        </customErrors>
0
What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

 
surajgupthaCommented:
Try removing the custom errors property or set mode as off
0
 
newbiewebAuthor Commented:
How do I comment this out?  Like this?

       <!--customErrors mode="RemoteOnly" defaultRedirect="GenericErrorPage.htm">
            <error statusCode="403" redirect="NoAccess.htm" />
            <error statusCode="404" redirect="FileNotFound.htm" />
        </customErrors-->
0
 
newbiewebAuthor Commented:
I think it was already commented out.  Here'e the original code:

        <!--
            The <customErrors> section enables configuration
            of what to do if/when an unhandled error occurs
            during the execution of a request. Specifically,
            it enables developers to configure html error pages
            to be displayed in place of a error stack trace.

        <customErrors mode="RemoteOnly" defaultRedirect="GenericErrorPage.htm">
            <error statusCode="403" redirect="NoAccess.htm" />
            <error statusCode="404" redirect="FileNotFound.htm" />
        </customErrors>
        -->
0
 
surajgupthaCommented:
When you run the page now, does it fail?
0
 
surajgupthaCommented:
What is the exception displayed?
Make sure that there is no CATCH block in ur code that might be supressing your exceptions.
0

Featured Post

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

  • 4
  • 4
Tackle projects and never again get stuck behind a technical roadblock.
Join Now