473,386 Members | 1,810 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Exception handling - line number question

Me
I am writing a web application and I want to catch and rethrow every
unhandled exception to the Application_Error. However, the line number
indicated in the stack trace is from the Throw line, rather than the line
where the error actually occurred. This seems counter intuitive.

Try
Throw New IndexOutOfRangeException
Catch ex As Exception
'At this point, the stack trace has the correct line number
Throw 'but in the Application_Error event, this line number is indicated
Finally
'Do some stuff here
End Try

It would be alot easier to troubleshoot if I knew the exact line number
where the error occurred... How can I do that short of creating my own
exception class, and using it in the Throw?

Thanks
Feb 22 '06 #1
0 1413

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

11
by: adi | last post by:
Dear all, This is more like a theoretical or conceptual question: which is better, using exception or return code for a .NET component? I had created a COM object (using VB6), which uses...
3
by: mailar | last post by:
Hi, Can someone tell me how to perform exception handling in DB2 UDFs(not procedures). ALso, while usin the SIGNAL statement in one of my UDFs I encountered an error message which is as below ...
8
by: Jonah Olsson | last post by:
Hi guys, For my VB.NET application, I created an ErrorHandler class that should save all available information about the last error occurred. I use Server.GetLastError for this. The problem is...
8
by: Adil Akram | last post by:
There are situations where you want to retry/rerun the same code again (if user wants) for unlimited times for a particular exception thrown. For example in situations like there's no CD in the...
132
by: Zorro | last post by:
The simplicity of stack unraveling of C++ is not without defective consequences. The following article points to C++ examples showing the defects. An engineer aware of defects can avoid...
41
by: Zytan | last post by:
Ok something simple like int.Parse(string) can throw these exceptions: ArgumentNullException, FormatException, OverflowException I don't want my program to just crash on an exception, so I must...
3
by: masood.iqbal | last post by:
In all the sample code snippets of try-catch code blocks that I have seen, the catch block does one of the following three things: 1). exits the program (after spitting out a cerr message) 2). ...
14
by: jehugaleahsa | last post by:
Hello: As an avid reader of C++ books, I know a lot of programmers out there are confronted with the challenge of exception safety. For those who don't know what it is, it is writing code in...
0
by: srizzler | last post by:
Hi All: I am trying to implement Exception Handling using Enterprise Library 3.1's Exception Handling Application Block as well as Logging Blocks. I have a windows application developed in...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.