Skip to content

Commit

Permalink
Improve timeout error message (#24)
Browse files Browse the repository at this point in the history
Co-authored-by: Sindre Sorhus <sindresorhus@gmail.com>
  • Loading branch information
Kikobeats and sindresorhus committed Oct 8, 2021
1 parent 495a0bb commit bf5d164
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion index.js
Expand Up @@ -9,7 +9,7 @@ export default function pTimeout(promise, milliseconds, fallback, options) {
let timer;
const cancelablePromise = new Promise((resolve, reject) => {
if (typeof milliseconds !== 'number' || milliseconds < 0) {
throw new TypeError('Expected `milliseconds` to be a positive number');
throw new TypeError(`Expected \`milliseconds\` to be a positive number, got \`${milliseconds}\``);
}

if (milliseconds === Number.POSITIVE_INFINITY) {
Expand Down

0 comments on commit bf5d164

Please sign in to comment.