File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed 
java/src/org/openqa/selenium/remote Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -572,10 +572,14 @@ protected Response execute(CommandPayload payload) {
572572        if  (e  instanceof  SessionNotCreatedException ) {
573573          toThrow  = (WebDriverException ) e ;
574574        } else  {
575+           // When this exception comes from a remote end, the real cause is usually hidden in the 
576+           // cause. Let's try to rescue it and display it at the top level. 
577+           String  cause  = e .getCause () != null  ? " "  + e .getCause ().getMessage () : "" ;
575578          toThrow  =
576579              new  SessionNotCreatedException (
577580                  "Possible causes are invalid address of the remote server or browser start-up" 
578-                       + " failure." ,
581+                       + " failure." 
582+                       + cause ,
579583                  e );
580584        }
581585      } else  if  (e  instanceof  WebDriverException ) {
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments