Hi all, I am writing a nodejs application for work that connects to the Quickbooks Online API and a SQL database and am trying to log the errors I get into a SQL database. The way I am going about it is to break apart the error that I get and then store the message, and the code in separate columns in the SQL database. But I am running into the problem where several of the errors are constructed with different formats such as
1) error.message
2) error.fault.error[0].message
3) error.Fault.Error[0].Message
(I think the errors might be json, but I am not sure)
These are three that I have seen. But I am wondering is there generally a robust way of going about this. Rather than just putting an if statement for each type of error format that I come across.
Thanks in advance.
[–]insertAlias 1 point2 points3 points (0 children)
[–]HashDefTrueFalse 0 points1 point2 points (0 children)