You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
constresult=awaitcsv().fromFile(filePath).subscribe(async(json,lineNumber)=>{constsaveResult=awaitsaveToDb(json);if(!saveResult.isSuccessful){log.error('throwing exception');log.error(saveResult.exception);// this shows the correct error messagethrownewError(saveResult.exception);}returnsaveResult;},(error)=>{log.error('subscribe.error returning error');log.error(error);// this seems to be undefined??returnerror;},()=>{log.info('subscribe.completed');});
I expected the error handler to receive the thrown error saveResult.exception, but error is undefined.
If I throw the Error, it seems to cause the promise to terminate incorrectly. If I don't throw the error, the result is the json from the parsing, not the result of the subscription processing.
Is there a way to get the error message out of subscribe?
The text was updated successfully, but these errors were encountered:
I have this:
I expected the error handler to receive the thrown error
saveResult.exception
, buterror
is undefined.If I throw the Error, it seems to cause the promise to terminate incorrectly. If I don't throw the error, the
result
is the json from the parsing, not the result of the subscription processing.Is there a way to get the error message out of
subscribe
?The text was updated successfully, but these errors were encountered: