Skip to content

Commit bcc4423

Browse files
authored
Merge pull request #165 from docusign/fix/error-message-display-for-user-import
Fix displaying error message for Bulk User Import code example
2 parents f5c89b3 + 0e0d8b4 commit bcc4423

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)