refactor [cdnjs] integration (#1668)
* pass error object to InvaildResponse() this prevents us from throwing TypeError: Cannot read property 'stack' of undefined when we attempt to parse invalid json * refactor [cdnjs] integration
This commit is contained in:
@@ -39,7 +39,7 @@ async function asJson({ buffer, res }) {
|
||||
try {
|
||||
return JSON.parse(buffer);
|
||||
} catch (err) {
|
||||
throw new InvalidResponse();
|
||||
throw new InvalidResponse(undefined, err);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user