Throwing and Catching Errors
Errors
π¨βπΌ Nice work! You made invalid input throw an error and used
try/catch to
recover with a helpful message.When you throw, you immediately exit the current flow.
catch gives you a
safe place to decide what happens next.