File tree Expand file tree Collapse file tree
validation_service_api/validation_service Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -92,10 +92,18 @@ async def get_user_info(self):
9292 raise HTTPException (
9393 status_code = status .HTTP_401_UNAUTHORIZED , detail = user_info ["message" ]
9494 )
95+ elif user_info .get ("statusCode" , None ) == 500 :
96+ raise HTTPException (
97+ status_code = status .HTTP_500_INTERNAL_SERVER_ERROR ,
98+ detail = f'Problem getting user_info: { user_info ["message" ]} '
99+ )
95100 logger .debug (user_info )
96- # make this compatible with the v1 json
97- user_info ["id" ] = user_info ["sub" ]
98- user_info ["username" ] = user_info .get ("preferred_username" , "unknown" )
101+ try :
102+ # make this compatible with the v1 json
103+ user_info ["id" ] = user_info ["sub" ]
104+ user_info ["username" ] = user_info .get ("preferred_username" , "unknown" )
105+ except KeyError :
106+ raise Exception (user_info )
99107 self ._user_info = user_info
100108 return self ._user_info
101109
You can’t perform that action at this time.
0 commit comments