diff --git a/vasl_templates/webapp/main.py b/vasl_templates/webapp/main.py index 3a61840..33d22f6 100644 --- a/vasl_templates/webapp/main.py +++ b/vasl_templates/webapp/main.py @@ -2,6 +2,7 @@ import os import json +import logging from flask import request, render_template, jsonify, send_file, redirect, url_for, abort @@ -30,7 +31,11 @@ def get_startup_msgs(): _check_versions = False # check the VASSAL version from vasl_templates.webapp.vassal import VassalShim - VassalShim.check_vassal_version( startup_msg_store ) + try: + VassalShim.check_vassal_version( startup_msg_store ) + except Exception as ex: #pylint: disable=broad-except + # NOTE: We can get here is VASSAL has been configured, but not Java - don't show an error to the user :-/ + logging.warning( "Can't get the VASSAL version: %s", ex ) # collect all the startup messages startup_msgs = {} diff --git a/vasl_templates/webapp/vassal.py b/vasl_templates/webapp/vassal.py index 727b5ec..062bbbc 100644 --- a/vasl_templates/webapp/vassal.py +++ b/vasl_templates/webapp/vassal.py @@ -312,7 +312,10 @@ class VassalShim: # NOTE: Using CREATE_NO_WINDOW doesn't fix the problem of VASSAL's UI sometimes appearing, # but it does hide the DOS box if the user has configured java.exe instead of javaw.exe. kwargs["creationflags"] = 0x8000000 # nb: win32process.CREATE_NO_WINDOW - proc = subprocess.Popen( args2, **kwargs ) + try: + proc = subprocess.Popen( args2, **kwargs ) + except FileNotFoundError as ex: + raise SimpleError( "Can't run the VASSAL shim (have you configured Java?): {}".format( ex ) ) try: proc.wait( timeout ) except subprocess.TimeoutExpired: