Skip to content

Commit 69af9aa

Browse files
committed
fix(portaswitch): handle expired access token and adjust error message arguments
1 parent 3c344cf commit 69af9aa

2 files changed

Lines changed: 3 additions & 1 deletion

File tree

app/bss/adapters/portaswitch/adapter.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1005,6 +1005,8 @@ def retrieve_call_recording(self, session: SessionInfo, call_recording: CallReco
10051005

10061006
except WebTritErrorException as error:
10071007
fault_code = extract_fault_code(error)
1008+
if fault_code in ("Client.Session.check_auth.failed_to_process_access_token",):
1009+
raise access_token_expired_error()
10081010
if fault_code in ("Server.CDR.xdr_not_found", "Server.CDR.invalid_call_recording_id",):
10091011
raise not_found_recording_error(recording_id)
10101012

app/bss/adapters/portaswitch/exceptions.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ def password_change_required_error():
6161

6262

6363
def refresh_token_invalid_error():
64-
return WebTritErrorException(422, "refresh_token_invalid", "Invalid refresh token")
64+
return WebTritErrorException(422, "Invalid refresh token", "refresh_token_invalid")
6565

6666

6767
def session_close_error():

0 commit comments

Comments
 (0)