File tree 2 files changed +13
-6
lines changed
packages/gatsby-source-wordpress/src
2 files changed +13
-6
lines changed Original file line number Diff line number Diff line change
1
+ const httpExceptionHandler = require ( `../http-exception-handler` )
2
+
3
+ describe ( `http-exception-handler` , ( ) => {
4
+ it ( `handles errors that lack responses without crashing` , ( ) => {
5
+ expect ( ( ) => httpExceptionHandler ( { } ) ) . not . toThrowError ( )
6
+ } )
7
+ } )
Original file line number Diff line number Diff line change @@ -7,12 +7,6 @@ const colorized = require(`./output-color`)
7
7
*/
8
8
function httpExceptionHandler ( e ) {
9
9
const { response, code } = e
10
- console . log (
11
- colorized . out (
12
- `\nPath: ${ response . request . path } ` ,
13
- colorized . color . Font . FgRed
14
- )
15
- )
16
10
if ( ! response ) {
17
11
console . log (
18
12
colorized . out (
@@ -22,6 +16,12 @@ function httpExceptionHandler(e) {
22
16
)
23
17
return
24
18
}
19
+ console . log (
20
+ colorized . out (
21
+ `\nPath: ${ response . request . path } ` ,
22
+ colorized . color . Font . FgRed
23
+ )
24
+ )
25
25
const {
26
26
status,
27
27
statusText,
You can’t perform that action at this time.
0 commit comments