oh-my-errors
Advanced tools
Comparing version 1.0.4 to 1.0.5
@@ -16,3 +16,2 @@ /* | ||
constructor (error) { | ||
this.error = true | ||
this.type = null | ||
@@ -19,0 +18,0 @@ this.code = null |
@@ -9,5 +9,3 @@ const Error = require('./Error') | ||
super.setType('unAuthorized') | ||
super.setSolutions([ | ||
solutions.relogin() | ||
]) | ||
super.setSolutions(data.solutions) | ||
} | ||
@@ -14,0 +12,0 @@ } |
@@ -40,6 +40,19 @@ const solutions = require('./Solutions/Solutions') | ||
origin: data.origin, | ||
message: data.message | ||
message: data.message, | ||
solutions: [ | ||
solutions.relogin() | ||
] | ||
}) | ||
} | ||
createUnauthorizedDemoError401 (data) { | ||
return new UnauthorizedError({ | ||
origin: data.origin, | ||
message: data.message, | ||
solutions: [ | ||
solutions.createAccount() | ||
] | ||
}) | ||
} | ||
createForbiddenError403 (data) { | ||
@@ -46,0 +59,0 @@ return new ForbiddenError({ |
@@ -20,2 +20,8 @@ class Solutions { | ||
createAccount () { | ||
return { | ||
type: 'createAccount' | ||
} | ||
} | ||
// Contact support team | ||
@@ -22,0 +28,0 @@ contact () { |
{ | ||
"name": "oh-my-errors", | ||
"version": "1.0.4", | ||
"version": "1.0.5", | ||
"description": "Simple node module to handle multiple server-side errors with solution strategies", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
8279
226