Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@rugk
Copy link
Member

@rugk rugk commented Aug 22, 2022

Fixes #7

The issue is here that a promise is usually expected, so I cannot just return
Promise.ject() with an empty error, because this also results in a red error
for the promise (with the worse error message "undefined").

Thus I've just made it to return a successful promise or undefined.

I've also changed the similar uncritical error when tips should be shown
according to gobal randomize, but no tip could be shown due to other factors,
so there is no tip to be shown.

Console.trace is BTW well-supported across browsers:
https://developer.mozilla.org/en-US/docs/Web/API/console/trace#browser_compatibility

Fixes #7

The issue is here that a promise is usually expected, so I cannot just return
Promise.ject() with an empty error, because this also results in a red error
for the promise (with the worse error message "undefined").

Thus I've just made it to return a successful promise or undefined.

I've also changed the similar uncritical error when tips should be shown
according to gobal randomize, but no tip could be shown due to other factors,
so there is no tip to be shown.

Console.trace is BTW well-supported across browsers:
https://developer.mozilla.org/en-US/docs/Web/API/console/trace#browser_compatibility
@rugk rugk force-pushed the reduceErrorClutter branch from 49a26ae to 6af2eef Compare August 22, 2022 18:44
@rugk
Copy link
Member Author

rugk commented Aug 22, 2022

/cc @tdulcet feel free to review

*
* @public
* @returns {Promise}
* @returns {Promise | undefined}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe the TypeScript compiler would complain about this...

Suggested change
* @returns {Promise | undefined}
* @returns {Promise<void> | void}

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.

Error: show no random tip, because randomize did not pass is not an error

3 participants