httpexceptions
Advanced tools
Comparing version 1.0.10 to 1.0.11
@@ -30,2 +30,6 @@ var HTTPException = (function () { | ||
} | ||
HTTPException.prototype.toString = function () { | ||
//console.warn(this.type + ': ' + this.status + ' ' + this.name + ' => ' + this.message) | ||
return this.name + '(' + this.status + '): ' + this.message; | ||
}; | ||
return HTTPException; | ||
@@ -32,0 +36,0 @@ })(); |
@@ -47,4 +47,10 @@ declare class Error { | ||
toString(){ | ||
//console.warn(this.type + ': ' + this.status + ' ' + this.name + ' => ' + this.message) | ||
return this.name + '('+this.status+'): ' + this.message; | ||
} | ||
} | ||
export = HTTPException; | ||
export = HTTPException; | ||
var __extends = (this && this.__extends) || function (d, b) { | ||
for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; | ||
function __() { this.constructor = d; } | ||
__.prototype = b.prototype; | ||
d.prototype = new __(); | ||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); | ||
}; | ||
@@ -7,0 +6,0 @@ var HTTPException = require('../http-exception'); |
var __extends = (this && this.__extends) || function (d, b) { | ||
for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; | ||
function __() { this.constructor = d; } | ||
__.prototype = b.prototype; | ||
d.prototype = new __(); | ||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); | ||
}; | ||
@@ -7,0 +6,0 @@ var HTTPException = require('../http-exception'); |
var __extends = (this && this.__extends) || function (d, b) { | ||
for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; | ||
function __() { this.constructor = d; } | ||
__.prototype = b.prototype; | ||
d.prototype = new __(); | ||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); | ||
}; | ||
@@ -7,0 +6,0 @@ var HTTPException = require('../http-exception'); |
var __extends = (this && this.__extends) || function (d, b) { | ||
for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; | ||
function __() { this.constructor = d; } | ||
__.prototype = b.prototype; | ||
d.prototype = new __(); | ||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); | ||
}; | ||
@@ -7,0 +6,0 @@ var HTTPException = require('../http-exception'); |
var __extends = (this && this.__extends) || function (d, b) { | ||
for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; | ||
function __() { this.constructor = d; } | ||
__.prototype = b.prototype; | ||
d.prototype = new __(); | ||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); | ||
}; | ||
@@ -7,0 +6,0 @@ var HTTPException = require('../http-exception'); |
var __extends = (this && this.__extends) || function (d, b) { | ||
for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; | ||
function __() { this.constructor = d; } | ||
__.prototype = b.prototype; | ||
d.prototype = new __(); | ||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); | ||
}; | ||
@@ -7,0 +6,0 @@ var HTTPException = require('../http-exception'); |
var __extends = (this && this.__extends) || function (d, b) { | ||
for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; | ||
function __() { this.constructor = d; } | ||
__.prototype = b.prototype; | ||
d.prototype = new __(); | ||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); | ||
}; | ||
@@ -7,0 +6,0 @@ var HTTPException = require('../http-exception'); |
var __extends = (this && this.__extends) || function (d, b) { | ||
for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; | ||
function __() { this.constructor = d; } | ||
__.prototype = b.prototype; | ||
d.prototype = new __(); | ||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); | ||
}; | ||
@@ -7,0 +6,0 @@ var HTTPException = require('../http-exception'); |
var __extends = (this && this.__extends) || function (d, b) { | ||
for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; | ||
function __() { this.constructor = d; } | ||
__.prototype = b.prototype; | ||
d.prototype = new __(); | ||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); | ||
}; | ||
@@ -7,0 +6,0 @@ var HTTPException = require('../http-exception'); |
var __extends = (this && this.__extends) || function (d, b) { | ||
for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; | ||
function __() { this.constructor = d; } | ||
__.prototype = b.prototype; | ||
d.prototype = new __(); | ||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); | ||
}; | ||
@@ -7,0 +6,0 @@ var HTTPException = require('../http-exception'); |
var __extends = (this && this.__extends) || function (d, b) { | ||
for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; | ||
function __() { this.constructor = d; } | ||
__.prototype = b.prototype; | ||
d.prototype = new __(); | ||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); | ||
}; | ||
@@ -7,0 +6,0 @@ var HTTPException = require('../http-exception'); |
var __extends = (this && this.__extends) || function (d, b) { | ||
for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; | ||
function __() { this.constructor = d; } | ||
__.prototype = b.prototype; | ||
d.prototype = new __(); | ||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); | ||
}; | ||
@@ -7,0 +6,0 @@ var HTTPException = require('../http-exception'); |
var __extends = (this && this.__extends) || function (d, b) { | ||
for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; | ||
function __() { this.constructor = d; } | ||
__.prototype = b.prototype; | ||
d.prototype = new __(); | ||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); | ||
}; | ||
@@ -7,0 +6,0 @@ var HTTPException = require('../http-exception'); |
{ | ||
"name": "httpexceptions", | ||
"version": "1.0.10", | ||
"version": "1.0.11", | ||
"description": "Provide exception for HTTP Rest API", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -24,2 +24,3 @@ /** | ||
expect(err.status).to.equal(502); | ||
expect(err.toString()).to.equal('BAD_GATEWAY(502): message'); | ||
} | ||
@@ -32,7 +33,7 @@ | ||
try{ | ||
throw new HTTPException.BadRequest('message'); | ||
throw new HTTPException.BadRequest('Parameters required [t1,t2]' ); | ||
}catch(err){ | ||
expect(err instanceof HTTPException.HTTPException).to.be.true; | ||
expect(err.status).to.equal(400); | ||
expect(err.toString()).to.equal('BAD_REQUEST(400): Parameters required [t1,t2]'); | ||
} | ||
@@ -50,2 +51,3 @@ | ||
expect(err.status).to.equal(403); | ||
expect(err.toString()).to.equal('FORBIDDEN(403): message'); | ||
} | ||
@@ -52,0 +54,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
173754
3779