How to read stack trace errors
Hello guys, consider the following error:
Can someone explain how should I proceed to "decrypt" the stack trace error please. Should I read from top to bottom or bottom to top? How to interpret each line and which lines are the most important ones where it actually tells us the parent line which causes the error please
16 Replies
LinkedLists.cs @ line 17
Topmost is the most recent
Unknown User•3w ago
Message Not Public
Sign In & Join Server To View
oh ok I see
Thanks !
Unknown User•3w ago
Message Not Public
Sign In & Join Server To View
Noted, thanks ! Will keep that in mind 👍
Unknown User•3w ago
Message Not Public
Sign In & Join Server To View
yeah that's true, why is that, I mean normally we should recognised line 16 as being the one that throws the exception, right? This is because of the Release mode?
Unknown User•3w ago
Message Not Public
Sign In & Join Server To View
AH, so it doesn't know that the exception is line 16 because it's a new exception ?
Unknown User•3w ago
Message Not Public
Sign In & Join Server To View
Like if we would have use DivideByZeroException, it would have work ?
Unknown User•3w ago
Message Not Public
Sign In & Join Server To View
yeah I see, the easier way is to use the second method ? Like we just pass the exception object? and additional info we want to convey ?
Unknown User•3w ago
Message Not Public
Sign In & Join Server To View
Okep, will have a look at that later on then, thanks ! Really appreciate, just learnt new things 💯
Stack traces will often contain a lot of lines of MS library code. Because the exception happens down there.
But you can often assume, that the actual error was produced in your code.
So the first step is always to read and understand the actual error / exception.
After that searching for the first mention of your own code in the stack trace is a good second step.