@pnpm/server
Advanced tools
Comparing version 0.8.1 to 0.8.2
@@ -53,14 +53,19 @@ "use strict"; | ||
return limit(() => __awaiter(this, void 0, void 0, function* () { | ||
const response = yield got(url, { | ||
body: JSON.stringify(body), | ||
headers: { 'Content-Type': 'application/json' }, | ||
method: 'POST', | ||
retries: () => { | ||
return 100; | ||
}, | ||
}); | ||
if (!response.body) { | ||
return undefined; | ||
try { | ||
const response = yield got(url, { | ||
body: JSON.stringify(body), | ||
headers: { 'Content-Type': 'application/json' }, | ||
method: 'POST', | ||
retries: () => { | ||
return 100; | ||
}, | ||
}); | ||
if (!response.body) { | ||
return undefined; | ||
} | ||
return JSON.parse(response.body); | ||
} | ||
return JSON.parse(response.body); | ||
catch (e) { | ||
throw JSON.parse(e.response.body); | ||
} | ||
})); | ||
@@ -67,0 +72,0 @@ } |
@@ -117,3 +117,5 @@ "use strict"; | ||
res.statusCode = 503; | ||
res.end(JSON.stringify(e.message)); | ||
const jsonErr = JSON.parse(JSON.stringify(e)); | ||
jsonErr.message = e.message; | ||
res.end(JSON.stringify(jsonErr)); | ||
} | ||
@@ -120,0 +122,0 @@ })); |
{ | ||
"name": "@pnpm/server", | ||
"version": "0.8.1", | ||
"version": "0.8.2", | ||
"description": "A pnpm installer server", | ||
@@ -50,3 +50,3 @@ "main": "lib/index.js", | ||
"tape": "^4.8.0", | ||
"ts-node": "^4.0.1", | ||
"ts-node": "^5.0.0", | ||
"tslint": "^5.8.0", | ||
@@ -53,0 +53,0 @@ "typescript": "^2.6.1" |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
23081
286