January 2020
Intermediate to advanced
532 pages
13h 31m
English
Often, an exception is raised from a function but it is not handled in the right away. The exception then travels to the parent calling function. If that function does not catch the exception either, it again travels to the next parent calling function. This process continues until a try-catch block catches the exception. At this point, the program's current stack frame – an execution context of where the code is currently running – handles the exception.
It would be tremendously useful if we can see where the exception was originally raised. To do that, let's first try to understand how to retrieve a stack trace that is an array of stack frames. Let's create a simple set of nested function calls such that they ...
Read now
Unlock full access