Deal with HTTP errors more gracefully
This commit is contained in:
@@ -180,9 +180,13 @@ export class Caps
|
|||||||
'rejectUnauthorized': false,
|
'rejectUnauthorized': false,
|
||||||
'method': 'GET',
|
'method': 'GET',
|
||||||
'encoding': null
|
'encoding': null
|
||||||
}, (err, _res, body) =>
|
}, (err, res, body) =>
|
||||||
{
|
{
|
||||||
if (err)
|
if (res.statusCode < 200 && res.statusCode > 299)
|
||||||
|
{
|
||||||
|
reject(new Error(body));
|
||||||
|
}
|
||||||
|
else if (err)
|
||||||
{
|
{
|
||||||
reject(err);
|
reject(err);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@caspertech/node-metaverse",
|
"name": "@caspertech/node-metaverse",
|
||||||
"version": "0.6.17",
|
"version": "0.6.18",
|
||||||
"description": "A node.js interface for Second Life.",
|
"description": "A node.js interface for Second Life.",
|
||||||
"main": "dist/lib/index.js",
|
"main": "dist/lib/index.js",
|
||||||
"types": "dist/lib/index.d.ts",
|
"types": "dist/lib/index.d.ts",
|
||||||
|
|||||||
Reference in New Issue
Block a user