bugsnag-sourcemaps
Advanced tools
Comparing version 1.0.2 to 1.0.3
@@ -0,1 +1,9 @@ | ||
# 1.0.3 | ||
## Maintenance | ||
* Improve error messaging (#20) | ||
* Ensure temporary directories are cleaned up (#20) | ||
* Ensure `sourceMap` option is set (#19) | ||
# 1.0.2 | ||
@@ -2,0 +10,0 @@ |
@@ -104,3 +104,3 @@ #!/usr/bin/env node | ||
.then(() => { | ||
return tasks.run(); | ||
return tasks.run().catch(err => {}); | ||
}); |
17
index.js
@@ -45,2 +45,5 @@ 'use strict'; | ||
} | ||
if (typeof options.sourceMap !== 'string') { | ||
throw new Error('You must provide a path to the source map you want to upload.') | ||
} | ||
if (options.addWildcardPrefix && !options.stripProjectRoot) { | ||
@@ -194,2 +197,8 @@ options.stripProjectRoot = true; | ||
.catch(err => { | ||
if (err.name === 'SyntaxError') { | ||
throw new Error(`Source map file was not valid JSON (${options.sourceMap})`) | ||
} | ||
if (err.code === 'ENOENT') { | ||
throw new Error(`Source map file does not exist (${options.sourceMap})`) | ||
} | ||
throw new Error(`Source map file could not be read (doesn't exist or isn't valid JSON).`); | ||
@@ -339,4 +348,6 @@ }) | ||
return new Promise((resolve, reject) => { | ||
if (options.tempDir && path.dirname(options.sourceMap) === options.tempDir) { | ||
fs.unlinkSync(options.sourceMap); | ||
if (options.tempDir) { | ||
if (path.dirname(options.sourceMap) === options.tempDir) { | ||
fs.unlinkSync(options.sourceMap); | ||
} | ||
fs.rmdir(options.tempDir, (err) => { | ||
@@ -367,4 +378,4 @@ if (err) { | ||
.then(validateOptions) | ||
.then(opts => options = opts) | ||
.then(transformOptions) | ||
.then(opts => options = opts) | ||
.then(prepareRequest) | ||
@@ -371,0 +382,0 @@ .then(sendRequest) |
{ | ||
"name": "bugsnag-sourcemaps", | ||
"version": "1.0.2", | ||
"version": "1.0.3", | ||
"keywords": [ | ||
@@ -5,0 +5,0 @@ "bugsnag", |
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
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
21540
489
0