Make the invalid board message nicer
This commit is contained in:
parent
878d8f479c
commit
a6d779c9fe
1 changed files with 3 additions and 1 deletions
|
@ -162,7 +162,9 @@ def hello():
|
|||
try:
|
||||
board = Board(request.args.get('board', None))
|
||||
except ValueError:
|
||||
return ("Invalid board.", 400, {'Content-type': 'text/plain'})
|
||||
out = 'Invalid board.'
|
||||
out += "\n\nPass a 'board' parameter to define the board, e.g. x+o++oxo+"
|
||||
return (out, 400, {'Content-type': 'text/plain'})
|
||||
|
||||
if not board.is_o_turn:
|
||||
return ("It isn't O's turn.\n\n{}".format(board), 400, {'Content-type': 'text/plain'})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue