Fixing Promise 'TypeError: myfunc(...).then(...).reject is not a function'

When encountering this error message in Javascript related to Promises:

promise_typeerror_output.txt
TypeError: myfunc(...).then(...).reject is not a function

The solution is quite simple: When you want to catch the error from the promise, you need to use catch instead of reject like this:

promise_fix.js
myfunc(...).then(...).catch(...)

Check out similar posts by category: Javascript