json-config-reader
Advanced tools
Comparing version 1.1.0 to 1.2.0
12
index.js
@@ -23,7 +23,7 @@ (function(fs, path){ | ||
} catch (err) { | ||
error = err; | ||
error = {"type":"parse", "message":"Failed to parse file as JSON!", "raw":err}; | ||
} | ||
} else { | ||
error = err; | ||
error = {"type":"read", "message":"Failed to read file!", "raw":err}; | ||
} | ||
@@ -41,3 +41,9 @@ call(error, config); | ||
} catch (err) { | ||
return err; | ||
if (err instanceof SyntaxError) { | ||
error = {"type":"parse", "message":"Failed to parse file as JSON!"}; | ||
} else { | ||
error = {"type":"parse", "message":"Failed to read file!"}; | ||
} | ||
error.raw = err; | ||
return error; | ||
} | ||
@@ -44,0 +50,0 @@ } |
{ | ||
"name": "json-config-reader", | ||
"version": "1.1.0", | ||
"version": "1.2.0", | ||
"description": "Reads and caches JSON configurations.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
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
5317
56