Skip to content

proper message instead of internal server error, remove unnecessary data#453

Merged
MoonTM-GIT merged 3 commits intoJava-Discord:mainfrom
danthe1st:user-api
Nov 6, 2023
Merged

proper message instead of internal server error, remove unnecessary data#453
MoonTM-GIT merged 3 commits intoJava-Discord:mainfrom
danthe1st:user-api

Conversation

@danthe1st
Copy link
Member

@danthe1st danthe1st commented Oct 24, 2023

Currently, the user API yields an internal server error when requesting a nonexistent user.
This PR changes it to actually throw an InvalidEntityIdException (as originally intended) which yields a 400 response with the error from JDA.

Examples:

{"status":"BAD_REQUEST","message":"Cannot fetch user: Unknown User","errors":["Entity should be of type: net.dv8tion.jda.api.entities.User"]}
{"status":"BAD_REQUEST","message":"Cannot fetch user: Invalid Form Body","errors":["Entity should be of type: net.dv8tion.jda.api.entities.User"]}

Furthermore, it removes preferences from that API since that seems unnecessary.

@danthe1st danthe1st requested a review from a team as a code owner October 24, 2023 09:58
@MoonTM-GIT MoonTM-GIT merged commit 24a9790 into Java-Discord:main Nov 6, 2023
@danthe1st danthe1st deleted the user-api branch November 6, 2023 21:36
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