In this exercise, you will implement a function called processString that processes a given input string with proper error handling.
You will learn how to:
Implement the processString function using a try…catch block.
Inside the try block:
TypeError.null.RangeError
SyntaxError.uppercase.Don't forget to attach appropriate error messages then you throw! An informative and well structured error message can save you hours of debugging.
Inside the catch block:
console.log
throw the error so it can be tested for its type.Implement various kinds of error handling and resource management.
An important point of programming is how to handle errors and close resources even if errors occur.
This exercise requires you to handle various errors. Because error handling is rather programming language specific you'll have to refer to the tests for your track to see what's exactly required.
Sign up to Exercism to learn and master JavaScript with 37 concepts159 exercises, and real human mentoring, all for free.