~johanvandegriff/games.johanv.xyz

666c614a87c96608384c63d3662379cf51413e85 — Johan Vandegriff 6 months ago 0fe1d66
handle BoggleError and display message
1 files changed, 6 insertions(+), 3 deletions(-)

M boggle.py
M boggle.py => boggle.py +6 -3
@@ 557,9 557,12 @@ def request_data(form, files):
                print("File saved to to:", destination)
                upload.save(destination)
                message = "File uploaded"
                lettersGuessed, confidence = processImage(destination)
                message += "; " + lettersGuessed
                message += "; " + str(confidence)
                try:
                    lettersGuessed, confidence = processImage(destination)
                    message += "; " + lettersGuessed
                    message += "; " + str(confidence)
                except BoggleError as e:
                    message += "; " + str(e)
            else:
                message = "File type not supported, please use .png, .jpg, .jpeg, or .gif"
        else: