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

refactor: use throw instead of Promise.reject #10712

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

Conversation

almeidx
Copy link
Member

@almeidx almeidx commented Jan 19, 2025

Refactored functions previously using Promise.{reject, resolve}() to use the more concise throw syntax, converting them to async functions.

Also fixed a rejection from #6210 by making the Shard#spawn method async.

@almeidx almeidx requested a review from a team as a code owner January 19, 2025 14:30
Copy link

vercel bot commented Jan 19, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

2 Skipped Deployments
Name Status Preview Comments Updated (UTC)
discord-js ⬜️ Ignored (Inspect) Visit Preview Jan 19, 2025 6:01pm
discord-js-guide ⬜️ Ignored (Inspect) Visit Preview Jan 19, 2025 6:01pm

Copy link
Contributor

@Renegade334 Renegade334 left a comment

Choose a reason for hiding this comment

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

InteractionResponses#awaitModalSubmit() has a similar issue to Shard#spawn():

awaitModalSubmit(options) {
if (typeof options.time !== 'number') throw new DiscordjsError(ErrorCodes.InvalidType, 'time', 'number');

Co-authored-by: Jiralite <33201955+Jiralite@users.noreply.github.com>
Co-authored-by: Renegade334 <Renegade334@users.noreply.github.com>
@almeidx almeidx force-pushed the refactor/async-fns branch from 338c962 to 1842f85 Compare January 19, 2025 18:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Review in Progress
Development

Successfully merging this pull request may close these issues.

4 participants