Wanted to see if this was possible and if so how. On Angular's .catch
block, I want to have my handleError callback and pass an id. but regardless the function gets called, I know it because of how the promise is formed. but I was hoping there was a way to still pass in a parameter without calling the function beforehand.
//controller
function handleError(id) {
showErrorMessage(id);
}
callFactory
.then(update)
.catch(handleError)
.finally(clearLoader);
// would like to use something like this.
callFactory
.then(update)
.catch(handleError(2)) //this gets called regardless
.finally(clearLoader);
handleError
thatcatch
can call.