Fix a typo (`e` -> `err`)

It `catch(e)`, but test for `err` in the catch block.