-
Notifications
You must be signed in to change notification settings - Fork 232
[REST API] Added HTTP status codes for bad auth/requests #1264
Conversation
* Updated API.md file
Pinging @JoeyyT to see if this has any negative consequences on your GUI (it shouldn't, with the codes it should be even be better to catch errors any errors (when the statuscode is not 200)). |
- POST `/api/bot/{name}/pokemon/{id}/evolve` => Evolve pokemon | ||
- POST `/api/bot/{name}/pokemon/{id}/powerup` => Power-up pokemon | ||
- POST `/api/bot/{name}/pokemon/{id}/evolve` => Evolve pokemon (HTTP status code 400 (Bad Request) when not enough candy) | ||
- POST `/api/bot/{name}/pokemon/{id}/powerup` => Power-up pokemon (HTTP status code 400 (Bad Request) when not enough candy) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
..or stardust
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've added a stardust check (that was missing).
nothing will change for TTL55, rather will be better, cause it's already in the js to show a failed message if not a 200 response received. |
…e sentences * Added missing stardust check on powerup
if (count == 0) { | ||
httpResponse.status = HttpServletResponse.SC_BAD_REQUEST | ||
return "Not enough incense" | ||
} else { | ||
itemBag.useIncense() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
log if usage successfull? maybe also for luckyegg and location change request
* Cleanup some one-use vars
* fix build * Updated AUTHORS.md (#1262) * API.md - Slashes missing in documentation (#1263) * Add checkstyle to Gradle build (#1246) * Enabled Checkstyle in Gradle * Added checkstyle to build.gradle (only check "src/main/kotlin" and not the libraries) * Fixed several checkstyle errors (File contains tab characters, Space needed before opening parenthesis, Line has trailing spaces) so the current checkstyle.xml builds without errors * * Added check to avoid "){" * [REST API] Added HTTP status codes for bad auth/requests (#1264) * * Added status codes on bad requests/auth * Updated API.md file * * Replaced string concatenations with proper ${}'s and cleaned up some sentences * Added missing stardust check on powerup * * Update API.md with stardust check * * Added more console logging * Cleanup some one-use vars * Improved config loading/saving (#1270) * Remove unused ProgramController * Renamed util.io.export*Writer classes/files * Moved BotService save/load to new class/file util.io.SettingsJSONWriter * Fix REST API pokedex indexes (#1275) * Fix missing pokemons (missingno #0, mew #151) in REST API pokedex call
Fixed issue: #1139 (comment)
Changes made:
the server cannot or will not process the request due to something that is perceived to be a client error
)/ auth 401