IO-256 Improved Logging
This commit is contained in:
@@ -78,7 +78,9 @@ exports.default = async (req, res) => {
|
||||
ret.push({
|
||||
billid: bill.id,
|
||||
success: false,
|
||||
errorMessage: JSON.stringify(error),
|
||||
errorMessage:
|
||||
(error && error.authResponse && error.authResponse.body) ||
|
||||
JSON.stringify(error),
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -113,7 +115,9 @@ async function QueryVendorRecord(oauthClient, req, bill) {
|
||||
);
|
||||
} catch (error) {
|
||||
logger.log("qbo-payables-error", "DEBUG", req.user.email, bill.id, {
|
||||
error: JSON.stringify(error),
|
||||
error:
|
||||
(error && error.authResponse && error.authResponse.body) ||
|
||||
JSON.stringify(error),
|
||||
method: "QueryVendorRecord",
|
||||
});
|
||||
throw error;
|
||||
@@ -136,7 +140,9 @@ async function InsertVendorRecord(oauthClient, req, bill) {
|
||||
return result && result.Vendor;
|
||||
} catch (error) {
|
||||
logger.log("qbo-payables-error", "DEBUG", req.user.email, bill.id, {
|
||||
error: JSON.stringify(error),
|
||||
error:
|
||||
(error && error.authResponse && error.authResponse.body) ||
|
||||
JSON.stringify(error),
|
||||
method: "InsertVendorRecord",
|
||||
});
|
||||
throw error;
|
||||
@@ -169,6 +175,9 @@ async function InsertBill(oauthClient, req, bill, vendor) {
|
||||
)
|
||||
),
|
||||
};
|
||||
logger.log("qbo-payable-objectlog", "DEBUG", req.user.email, bill.id, {
|
||||
billQbo,
|
||||
});
|
||||
try {
|
||||
const result = await oauthClient.makeApiCall({
|
||||
url: urlBuilder(
|
||||
@@ -185,7 +194,9 @@ async function InsertBill(oauthClient, req, bill, vendor) {
|
||||
return result && result.Bill;
|
||||
} catch (error) {
|
||||
logger.log("qbo-payables-error", "DEBUG", req.user.email, bill.id, {
|
||||
error: JSON.stringify(error),
|
||||
error:
|
||||
(error && error.authResponse && error.authResponse.body) ||
|
||||
JSON.stringify(error),
|
||||
method: "InsertBill",
|
||||
});
|
||||
throw error;
|
||||
|
||||
Reference in New Issue
Block a user