From 345f90388b6bae4fce3e2b1427b7d1edbcc66513 Mon Sep 17 00:00:00 2001 From: shrouti1507 <60211312+shrouti1507@users.noreply.github.com> Date: Wed, 31 Jan 2024 14:47:34 +0530 Subject: [PATCH] Apply suggestions from code review Co-authored-by: Sankeerth --- src/v0/util/facebookUtils/networkHandler.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/v0/util/facebookUtils/networkHandler.js b/src/v0/util/facebookUtils/networkHandler.js index 3dcd252811..79b7d92810 100644 --- a/src/v0/util/facebookUtils/networkHandler.js +++ b/src/v0/util/facebookUtils/networkHandler.js @@ -111,6 +111,14 @@ const errorDetailsMap = { 'The session has been invalidated because the user changed their password or Facebook has changed the session for security reasons', ) .build(), + + 463: new ErrorDetailsExtractorBuilder() + .setStatus(400) + .setStat({ + [tags.TAG_NAMES.ERROR_TYPE]: tags.ERROR_TYPES.ACCESS_TOKEN_EXPIRED, + }) + .setMessageField('message') + .build(), default: new ErrorDetailsExtractorBuilder() .setStatus(400) .setStat({ @@ -251,7 +259,7 @@ const errorResponseHandler = (destResponse) => { } const { error } = response; const { status, errorMessage, stats: errorStatTags } = getStatus(error); - if (isDefinedAndNotNull(errorStatTags) && errorStatTags?.errorType === 'accessTokenExpired') { + if (isDefinedAndNotNull(errorStatTags) && errorStatTags?.[tags.TAG_NAMES.ERROR_TYPE] === 'accessTokenExpired') { throw new ConfigurationAuthError(`${errorMessage}`); } throw new NetworkError(