File tree 1 file changed +14
-2
lines changed
1 file changed +14
-2
lines changed Original file line number Diff line number Diff line change @@ -45,7 +45,18 @@ const iPadPro = devices['iPad Pro landscape'];
45
45
46
46
// Navigate to page
47
47
utils . log ( 'Loading page...' )
48
- await page . goto ( argv . url , { timeout : 120000 } )
48
+ let errors = [ ]
49
+ await page . goto ( argv . url , { timeout : 120000 } ) . catch ( async e => {
50
+ errors . push ( e )
51
+ utils . log ( `Error: Couldn't navigate to ${ argv . url } ` )
52
+ } )
53
+
54
+ // If errors happened then we'll need to terminate
55
+ if ( errors . length > 0 ) {
56
+ await page . close ( )
57
+ await browser . close ( )
58
+ return 'navigationError'
59
+ }
49
60
50
61
// Wait for given amount in ms
51
62
if ( argv . wait ) {
@@ -57,8 +68,9 @@ const iPadPro = devices['iPad Pro landscape'];
57
68
const finalUrl = await page . url ( )
58
69
utils . log ( `URL given as a parameter: ${ argv . url } Document downloaded from URL: ${ finalUrl } ` )
59
70
60
- // Close the page
71
+ // Close the page & browser
61
72
utils . log ( 'Closing the page...' )
73
+ await page . close ( )
62
74
await browser . close ( )
63
75
64
76
// Figure out the compare to origins
You can’t perform that action at this time.
0 commit comments