backend-manager 3.2.67 → 3.2.68

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "backend-manager",
3
- "version": "3.2.67",
3
+ "version": "3.2.68",
4
4
  "description": "Quick tools for developing Firebase functions",
5
5
  "main": "src/manager/index.js",
6
6
  "bin": {
@@ -355,7 +355,8 @@ BackendAssistant.prototype.errorify = function (e, options) {
355
355
  options = options || {};
356
356
 
357
357
  // Code: default to 500, or else use the user's option
358
- options.code = typeof options.code === 'undefined'
358
+ const isCodeSet = typeof options.code !== 'undefined';
359
+ options.code = !isCodeSet
359
360
  ? 500
360
361
  : options.code;
361
362
 
@@ -385,7 +386,8 @@ BackendAssistant.prototype.errorify = function (e, options) {
385
386
  : new Error(stringify(e));
386
387
 
387
388
  // Fix code
388
- options.code = newError.code || options.code;
389
+ // options.code = newError.code || options.code;
390
+ options.code = isCodeSet ? options.code : newError.code || options.code;
389
391
  options.code = parseInt(options.code);
390
392
  options.code = isBetween(options.code, 400, 599) ? options.code : 500;
391
393