File tree Expand file tree Collapse file tree 1 file changed +17
-5
lines changed Expand file tree Collapse file tree 1 file changed +17
-5
lines changed Original file line number Diff line number Diff line change @@ -60,15 +60,27 @@ async function createPage({ files, processors= {}}) {
60
60
const output = [ ] ;
61
61
62
62
page . on ( 'console' , async msg => {
63
- console . log ( "console" , msg )
64
- output . push ( { type : msg . type ( ) , text : msg . text ( ) , content : await Promise . all ( msg . args ( ) . map ( e => e . jsonValue ( ) ) ) } )
63
+
64
+ const entry = { type : msg . type ( ) , text : msg . text ( ) , content : await Promise . all ( msg . args ( ) . map ( e => e . jsonValue ( ) ) ) } ;
65
+ if ( isDev )
66
+ console . log ( entry ) ;
67
+ output . push ( entry ) ;
65
68
} ) ;
69
+
66
70
page . on ( 'pageerror' , error => {
67
- console . log ( "pageerror" , error )
68
- output . push ( { type : 'pageerror' , text : error . message , content : error } )
71
+
72
+ // Emitted when an uncaught exception happens within the page.
73
+
74
+ const entry = { type : 'pageerror' , text : error . message , content : error } ;
75
+ console . log ( entry ) ;
76
+ output . push ( entry ) ;
69
77
} ) ;
78
+
70
79
page . on ( 'error' , msg => {
71
- console . log ( 'error' , msg )
80
+
81
+ // Emitted when the page crashes.
82
+
83
+ console . log ( 'error' , msg ) ;
72
84
} ) ;
73
85
74
86
//page.done = new Promise(resolve => page.exposeFunction('_done', resolve));
You can’t perform that action at this time.
0 commit comments