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

Error Handling — Example 111

Quick explanation + ready code for: Error Handling.

F# Error Handling Back to examples
Back to language
Syntax: Error Handling in F#. ID: #111

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.