Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make TimeoutError have a proper "message" in the stack trace #8

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

TooTallNate
Copy link

Before:

> console.log(err.stack)
Error
    at new module.exports.TimeoutError (/Code/promise-timeout/index.js:44:16)
    at repl:1:13
    at Script.runInThisContext (vm.js:91:20)
    …

Now:

> console.log(err.stack)
TimeoutError: Promise did not resolve within 2000ms
    at repl:1:13
    at Script.runInThisContext (vm.js:91:20)
    …

@msangel
Copy link

msangel commented Dec 28, 2018

TimeoutError constructor should accept the message as the any error do.
So pt.timeout should accept 3rd optional argument which became that message

> messageOnError = "File loading time out!"
> pt.timeout(promise, timeout, messageOnError)
TimeoutError: File loading time out!
    at repl:1:13
    at Script.runInThisContext (vm.js:91:20)

@itsmunim
Copy link

itsmunim commented Jan 5, 2023

Why it was never merged?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants