File tree Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -15,6 +15,7 @@ import {
15
15
import axeTestUrls from '../lib/axe-test-urls' ;
16
16
import event from '../lib/events' ;
17
17
import { startDriver } from '../lib/webdriver' ;
18
+ import { error as selenium_error } from 'selenium-webdriver' ;
18
19
19
20
const cli = async (
20
21
args : OptionValues ,
@@ -108,8 +109,19 @@ const cli = async (
108
109
rules,
109
110
disable
110
111
} ;
112
+ let outcome ;
111
113
try {
112
- const outcome = await axeTestUrls ( urls , testPageConfigParams , events ) ;
114
+ try {
115
+ outcome = await axeTestUrls ( urls , testPageConfigParams , events ) ;
116
+ } catch ( e ) {
117
+ if ( e instanceof selenium_error . ScriptTimeoutError ) {
118
+ console . error ( error ( 'Error: %s' ) , e . message ) ;
119
+ console . log ( `The timeout is currently configured to be ${ timeout } seconds (you can change it with --timeout).` )
120
+ process . exit ( 2 ) ;
121
+ } else {
122
+ throw e ;
123
+ }
124
+ }
113
125
if ( silentMode ) {
114
126
process . stdout . write ( JSON . stringify ( outcome , null , 2 ) ) ;
115
127
return ;
You can’t perform that action at this time.
0 commit comments