DrSchool Learn coding, fast.
EN AR BN CS DE EL Search

Error Handling — Example 114

Quick explanation + ready code for: Error Handling.

LiveCode Error Handling Back to examples
Back to language
Syntax: Error Handling in LiveCode. ID: #114

Code

try{
  JSON.parse("{bad}");
}catch(e){
  console.log("error:", e.message);
}

Notes

You can copy this snippet and adapt it. For advanced, add real-world inputs, edge cases, and tests.