Skip to content

Commit

Permalink
fix: improve error messages readability
Browse files Browse the repository at this point in the history
  • Loading branch information
medikoo committed Jun 1, 2018
1 parent 6a18fe0 commit af86a9a
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion modifiers/d.js
Expand Up @@ -4,6 +4,6 @@ module.exports = function (value/*, placeholder, argIndex, args*/) {
try {
return String(Number(value));
} catch (e) {
return "<Non-coercible (to number) value>";
return "<Non-coercible to number value>";
}
};
2 changes: 1 addition & 1 deletion modifiers/f.js
Expand Up @@ -4,6 +4,6 @@ module.exports = function (value/*, placeholder, argIndex, args*/) {
try {
return String(isNaN(value) ? parseFloat(value) : Number(value));
} catch (e) {
return "<Non-coercible (to float) value>";
return "<Non-coercible to float value>";
}
};
2 changes: 1 addition & 1 deletion modifiers/i.js
Expand Up @@ -6,6 +6,6 @@ module.exports = function (value/*, placeholder, argIndex, args*/) {
try {
return String(isNaN(value) ? parseInt(value, 10) : toInteger(value));
} catch (e) {
return "<Non-coercible (to integer) value>";
return "<Non-coercible to integer value>";
}
};
4 changes: 2 additions & 2 deletions modifiers/j.js
Expand Up @@ -16,8 +16,8 @@ module.exports = function (value/*, placeholder, argIndex, args*/) {
return JSON.stringify(value, null, 2);
} catch (e) {
if (e.message === CIRCULAR_JSON_ERROR_MESSAGE) {
return "<Circular (non-JSON serializable) value>";
return "<Circular non-JSON serializable value>";
}
return "<Non-serializable (to JSON) value>";
return "<Non-serializable to JSON value>";
}
};

0 comments on commit af86a9a

Please sign in to comment.