File tree Expand file tree Collapse file tree 2 files changed +8
-3
lines changed 
web/server/src/simcore_service_webserver/security Expand file tree Collapse file tree 2 files changed +8
-3
lines changed Original file line number Diff line number Diff line change 99
1010import  httpx 
1111import  pytest 
12- from  asyncpg  import  PostgresError 
1312from  aws_library .s3 ._errors  import  S3AccessError , S3KeyNotFoundError 
1413from  fastapi  import  FastAPI , HTTPException , status 
1514from  fastapi .exceptions  import  RequestValidationError 
2827    DatcoreAdapterTimeoutError ,
2928)
3029from  simcore_service_storage .modules .db .access_layer  import  InvalidFileIdentifierError 
30+ from  sqlalchemy .exc  import  DBAPIError 
3131
3232
3333@pytest .fixture  
@@ -85,7 +85,12 @@ async def client(initialized_app: FastAPI) -> AsyncIterator[AsyncClient]:
8585            status .HTTP_422_UNPROCESSABLE_ENTITY , 
8686        ), 
8787        ( 
88-             PostgresError ("pytest postgres error" ), 
88+             DBAPIError .instance ( 
89+                 statement = "pytest statement" , 
90+                 params = {}, 
91+                 orig = Exception ("pytest original" ), 
92+                 dbapi_base_err = Exception ("pytest dbapi base error" ), 
93+             ), 
8994            status .HTTP_503_SERVICE_UNAVAILABLE , 
9095        ), 
9196        ( 
Original file line number Diff line number Diff line change @@ -50,7 +50,7 @@ def _handle_exceptions_as_503():
5050    except  DatabaseError  as  err :
5151        _logger .exception (
5252            ** create_troubleshooting_log_kwargs (
53-                 MSG_AUTH_NOT_AVAILABLE   +   " : Auth unavailable due to database error." ,
53+                 f" { MSG_AUTH_NOT_AVAILABLE }  : Auth unavailable due to database error." ,
5454                error = err ,
5555                error_context = {"origin" : str (err .orig ) if  err .orig  else  None },
5656                tip = "Check database connection" ,
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments