Skip to content

Fix backend for create game#182

Open
utiq wants to merge 5 commits into
mainfrom
create-game-backend
Open

Fix backend for create game#182
utiq wants to merge 5 commits into
mainfrom
create-game-backend

Conversation

@utiq

@utiq utiq commented Nov 9, 2022

Copy link
Copy Markdown
Collaborator

No description provided.

Comment thread .vscode/settings.json
Comment on lines -1 to -13
{
"cSpell.words": [
"colourblind",
"gameplay",
"passwordcheck",
"Protanope",
"rulebook",
"tritanope",
"xsss",
"themer",
"tritanope"
]
}

Copy link
Copy Markdown
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
Copy Markdown
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 thread api.php
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
Copy Markdown
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
Copy Markdown
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