File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed
Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -81,12 +81,12 @@ export function getStyles(nodes) {
8181}
8282
8383export class HttpError extends Error {
84- constructor ( { url, statusCode, statusText } ) {
84+ constructor ( { url, statusCode, originalMessage } ) {
8585 super ( )
8686 this . url = url
87- this . statusCode = statusCode
88- this . statusText = statusText
89- this . message = `The origin server at " ${ url } " errored with status ${ statusCode } ( ${ statusText } )`
87+ this . statusCode = statusCode === 'ENOTFOUND' ? 404 : 500
88+ this . message = `The origin server at " ${ url } " errored with statusCode ${ statusCode } `
89+ this . originalMessage = originalMessage
9090 }
9191}
9292
@@ -100,7 +100,7 @@ export async function extractCss(url) {
100100 headers = response . headers
101101 } catch ( error ) {
102102 console . error ( error )
103- throw new HttpError ( { url, statusCode : error . code , statusText : error . message } )
103+ throw new HttpError ( { url, statusCode : error . code , originalMessage : error . message } )
104104 }
105105
106106 // Return early if our response was a CSS file already
You can’t perform that action at this time.
0 commit comments