Intermediate Reading #stack-traces #exceptions #debugging

Reading Stack Traces

5 exercises on reading Java, Python, and Node.js stack traces — identify the root cause line, understand frame ordering, and follow exception chains.

Stack trace reading rules
  • Frames are listed most-recent first — the top frame is where the error occurred
  • Read the exception type and message first (first line)
  • Find your code in the frames — skip library/JDK internals
  • In Python, "During handling of…" signals exception chaining
  • ECONNREFUSED = nothing is listening on that host:port
0 / 5 completed
1 / 5
🔴 Java Stack Trace
Exception in thread "main" java.lang.NullPointerException: Cannot invoke "String.length()" because "str" is null
	at com.example.app.StringUtils.countVowels(StringUtils.java:23)
	at com.example.app.TextAnalyser.analyse(TextAnalyser.java:58)
	at com.example.app.Main.run(Main.java:14)
	at com.example.app.Main.main(Main.java:9)
Read the Java stack trace above. Which line contains the root cause of the exception — the line where execution actually failed?