@adonisjs/generic-exceptions
Advanced tools
Comparing version 2.0.0 to 2.0.1
@@ -0,1 +1,6 @@ | ||
<a name="2.0.1"></a> | ||
## [2.0.1](https://github.com/adonisjs/adonis-generic-exceptions/compare/v2.0.0...v2.0.1) (2018-05-11) | ||
<a name="2.0.0"></a> | ||
@@ -2,0 +7,0 @@ # [2.0.0](https://github.com/adonisjs/adonis-generic-exceptions/compare/v1.0.0...v2.0.0) (2018-01-16) |
{ | ||
"name": "@adonisjs/generic-exceptions", | ||
"version": "2.0.0", | ||
"version": "2.0.1", | ||
"description": "List of generic exceptions to be used in all other repos", | ||
@@ -11,3 +11,5 @@ "main": "index.js", | ||
"scripts": { | ||
"test": "echo \"Error: no test specified\" && exit 1" | ||
"lint": "standard", | ||
"pretest": "npm run lint", | ||
"test": "japa test.js" | ||
}, | ||
@@ -14,0 +16,0 @@ "keywords": [ |
@@ -27,3 +27,3 @@ 'use strict' | ||
* Missing config exception is thrown when configuration | ||
* is not define for a given key | ||
* is not defined for a given key | ||
* | ||
@@ -57,2 +57,16 @@ * @method missingConfig | ||
} | ||
/** | ||
* This exception is raised when environment variable | ||
* is not defined, but is required for app operation. | ||
* | ||
* @method missingEnvKey | ||
* | ||
* @param {String} environment variable name (e.g. `HOME` or `PATH`) | ||
* | ||
* @return {RuntimeException} | ||
*/ | ||
static missingEnvKey (key) { | ||
const message = `Make sure to define environment variable ${key}.` | ||
return new this(message, 500, 'E_MISSING_ENV_KEY', this.repo) | ||
} | ||
@@ -59,0 +73,0 @@ /** |
@@ -30,3 +30,3 @@ 'use strict' | ||
GE.InvalidArgumentException.missingParameter('lucid', 'username', '2nd').message, | ||
'E_MISSING_PARAMETER: Missing parameter username expected by lucid as 2nd parameter\n> More details: https://err.sh/adonisjs/errors/E_MISSING_PARAMETER' | ||
'E_MISSING_PARAMETER: Missing parameter username expected by lucid method as 2nd parameter\n> More details: https://err.sh/adonisjs/errors/E_MISSING_PARAMETER' | ||
) | ||
@@ -50,2 +50,7 @@ | ||
assert.equal( | ||
GE.RuntimeException.missingEnvKey('FOO').message, | ||
'E_MISSING_ENV_KEY: Make sure to define environment variable FOO.\n> More details: https://err.sh/adonisjs/errors/E_MISSING_ENV_KEY' | ||
) | ||
assert.equal( | ||
GE.RuntimeException.incompleteConfig(['foo'], 'bar').message, | ||
@@ -52,0 +57,0 @@ 'E_INCOMPLETE_CONFIG: Make sure to define foo inside bar\n> More details: https://err.sh/adonisjs/errors/E_INCOMPLETE_CONFIG' |
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
No tests
QualityPackage does not have any tests. This is a strong signal of a poorly maintained or low quality package.
Found 1 instance in 1 package
12666
237
1