Jim
Jim

Reputation: 1

I am not being able to see a detailed output of a server error?

In asp.net, i can't see the detailed message of the server when an error is present. I mean, when you open a browser and navigate to say http://[errorpage].com and the page shows something like "internal server error - the server is busy" - surely you know that the server is busy...but with my application i get only error 503 - but i cant go as far as mozilla browser goes and cannot see the entire error message. I tried to catch and display the exception - but...no. also i tried to parse the source with regular exp. - but i guess net stops whenever error is present and cannot proceed to parsing - also...without trycatching: same thing.

Upvotes: 0

Views: 132

Answers (4)

John Saunders
John Saunders

Reputation: 161773

If you turn on ASP.NET Health Monitoring, then ASP.NET will log details of the error to the Windows Event Log or any other destination you specify.

Upvotes: 0

Rikon
Rikon

Reputation: 2696

Your question is a little manic, but you've got to consider what error handling is going on up the stack if this is happening:

try{
   //Something
}
catch(Exception){
   //Handle it some how
   throw new Exception("Broken");
}

then this will loose all of the call stack before the new exception is thrown. If this is happening it can be fixed like this:

try{
   //Something
}
catch(Exception){
   //Handle it some how
   throw;
}

this continues to throw the original exception with stack trace.

Upvotes: 0

Darthg8r
Darthg8r

Reputation: 12675

As a rule, don't enable this on live websites. In your web.config, add/edit the following:

<customErrors mode="Off" />

This will start showing detailed info about the error. But again, DO NOT do this on a live server, or at least not permanently, as it is a security hazard.

Upvotes: 1

Senad Meškin
Senad Meškin

Reputation: 13756

The best way to do that is to implement error handling into your code, then save errors somewhere (database, file ...) Then you can look into your file and get a full error

e.g.

try {
   //your code here
}
catch(Exception ex)
{
   //write to file ex.ToString() to see whole stack trace, or ex.Message to see just message like "index out of bounds"
}

and also if you want to get errors in browser then turn it on in your config file

look at this link for details http://msdn.microsoft.com/en-us/library/h0hfz6fc.aspx

Upvotes: 0

Related Questions