Skip to content

Commit 0e0d8b4

Browse files
fix error messages
1 parent 102fe2b commit 0e0d8b4

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lib/admin/controllers/eg004ImportUser.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,9 @@ eg004ImportUser.createController = async (req, res) => {
5252
console.log(req.session.importId);
5353
} catch (error) {
5454
// we can pull the DocuSign error code and message from the response body
55-
const errorBody = error && error.response && error.response.body;
56-
const errorCode = errorBody && errorBody.errorCode;
57-
const errorMessage = errorBody && errorBody.message;
55+
const errorBody = error?.response?.body;
56+
const errorCode = errorBody?.errorCode || errorBody?.error;
57+
const errorMessage = errorBody?.message || errorBody?.error_description;
5858

5959
// In production, may want to provide customized error messages and
6060
// remediation advice to the user.

0 commit comments

Comments
 (0)