#paulwest-confirm-error
1 messages · Page 1 of 1 (latest)
why not use async/await and try/catch block??
I cut down the code to make it more readable.
I appreciate there are other ways this can be done.
I just want to know when the error object can't be read in the catch block.
I will add some more code.
expaned catch block
.catch(error => {
alert (error)
}
Yeah there are various reasons this could be happening, the full snippet would be best.
returns Cannot read properties of undefined (reading 'id')
Hmm okay one sec
I can give you the full code if you wish
Yeah that would make it easier
Too big for me to send. I will try and rationalise it down to
Ah
I see it
You have an extra .
.catch(error => {```
Try removing that?
One of those
that was a typo, it does not exist
The code is working, it is hitting the catch block and executing the code inside, I just can't seem to access the error object.
Ah okay so what is happening is that the promise is fulfilling and your error is in your results block
Figured, that might be the case, i was trying to avoid having to put a hard to read if else statement inside the .then.