I am trying to differentiate between the different errors by taking different actions depending on the error detected. Here is a code example:
const myFunc =