Skip to content

Commit

Permalink
fix: allow silent clearing of non-existent spinner labels
Browse files Browse the repository at this point in the history
  • Loading branch information
Anton Drukh committed Sep 9, 2018
1 parent fb1d018 commit fa520a3
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/spinner.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ createSpinner.sticky = function (s) {
createSpinner.clear = function (label) {
return function (res) {
if (spinners[label] === undefined) {
throw new Error('unknown spinner label: ' + label);
// clearing a non-existend spinner is ok by default
return res;
}

debug('clearing %s (%s)', label, spinners[label].length);
Expand Down

0 comments on commit fa520a3

Please sign in to comment.