Error handling, "try...catch" thumbnail
Error handling, "try...catch"
javascript.info
If it exists, it runs in all cases: So, try...catch can only handle errors that occur in valid code. If an exception happens in “scheduled” code, like in setTimeout, then try...catch won’t catch it The finally clause works for any exit from try...catch. That includes an explicit return. For all buil
8 Users
0 Comments
103 Highlights
1 Notes

Top Highlights

  • If it exists, it runs in all cases:
  • So, try...catch can only handle errors that occur in valid code.
  • If an exception happens in “scheduled” code, like in setTimeout, then try...catch won’t catch it
  • The finally clause works for any exit from try...catch. That includes an explicit return.
  • For all built-in errors, the error object has two main properties: name Error name. For instance, for an undefined variable that’s "ReferenceError". message Textual message about error details.

Tags

Javascript

Ready to highlight and find good content?

Glasp is a social web highlighter that people can highlight and organize quotes and thoughts from the web, and access other like-minded people’s learning.