ali-cdn-sdk
Advanced tools
Comparing version 1.0.5 to 1.1.0
@@ -5,6 +5,7 @@ 'use strict'; | ||
constructor(message) { | ||
constructor(message, status) { | ||
super(message); | ||
this.name = this.constructor.name; | ||
this.message = message; | ||
this.status = status; | ||
Error.captureStackTrace(this, this.constructor); | ||
@@ -11,0 +12,0 @@ } |
@@ -5,6 +5,7 @@ 'use strict'; | ||
constructor(message) { | ||
constructor(message, status) { | ||
super(message); | ||
this.name = this.constructor.name; | ||
this.message = message; | ||
this.status = status; | ||
Error.captureStackTrace(this, this.constructor); | ||
@@ -11,0 +12,0 @@ } |
@@ -56,7 +56,7 @@ 'use strict'; | ||
message = `invalid arguments: ${response.data && response.data.Message}`; | ||
throw new errors.ValidationError(message); | ||
throw new errors.ValidationError(message, response.status); | ||
} | ||
if (response.status !== 200) { | ||
message = `unexpect error: ${response.data && response.data.Message}`; | ||
throw new errors.CdnError(message); | ||
throw new errors.CdnError(message, response.status); | ||
} | ||
@@ -63,0 +63,0 @@ |
{ | ||
"name": "ali-cdn-sdk", | ||
"version": "1.0.5", | ||
"version": "1.1.0", | ||
"description": "阿里云 cdn sdk", | ||
@@ -5,0 +5,0 @@ "main": "lib/sdk.js", |
9646
361