Skip to content

Commit 35ffd50

Browse files
committed
add error handle for updateuser
1 parent 068621c commit 35ffd50

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

packages/lib/auth0.cfc

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -313,13 +313,16 @@ component {
313313
if (structKeyExists(arguments, "userMetadata")) body["user_metadata"] = arguments.userMetadata;
314314
if (structKeyExists(arguments, "appMetadata")) body["app_metadata"] = arguments.appMetadata;
315315
if (structKeyExists(arguments, "username")) body["username"] = arguments.username;
316-
317-
var result = makeRequest(
318-
method = "PATCH",
319-
endpoint = "/api/v2/users/#arguments.userID#",
320-
body = body,
321-
token = token
322-
);
316+
try {
317+
var result = makeRequest(
318+
method = "PATCH",
319+
endpoint = "/api/v2/users/#arguments.userID#",
320+
body = body,
321+
token = token
322+
);
323+
} catch (any e) {
324+
return deserializeJSON(e.Detail);
325+
}
323326

324327
return result;
325328
}

0 commit comments

Comments
 (0)