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

Fix backend for create game #182

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open

Fix backend for create game #182

wants to merge 5 commits into from

Conversation

utiq
Copy link
Collaborator

@utiq utiq commented Nov 9, 2022

No description provided.

Comment on lines -1 to -13
{
"cSpell.words": [
"colourblind",
"gameplay",
"passwordcheck",
"Protanope",
"rulebook",
"tritanope",
"xsss",
"themer",
"tritanope"
]
}
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I know you use VIM to code. In VS code it's possible to spell check (I'm sure in vim is possible too)
The settings.json can allow adding any local config for VS Code, in this case, all the words that the spell checker should exclude. You deleted it because it's a public repo?

Copy link
Owner

Choose a reason for hiding this comment

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

I also use vscode. But I use settings.json to encode my personal settings (e.g. type checking), so when I try to switch to your branch there's a conflict. Not sure how to resolve this but I don't think we need to check in your spellcheck settings?

Comment on lines -1617 to -1626
} catch(Exception $e) {
// return $this->JSONResponse(
// $e->getMessage(),
// '',
// false,
// $payload
// );
throw new RequestException(
$this->JSONResponse('A gameID is required.', '', false, [])
);
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

if you remove the try | catch, and if the API has an error, the error will not be returned in JSON format.
I use Insomnia to test my API endpoints, you can test with this endpoint.

image

Try changing the bet to 3, and the correct JSON error should be returned. With the change you made, an HTML error is returned.

Copy link
Owner

Choose a reason for hiding this comment

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

If you can get your wrapper to return a proper error message with stack trace as JSON, that would be awesome.

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.

2 participants