diff --git a/benchmark/space/draw.py b/benchmark/space/draw.py index 4207a5a..b024f72 100644 --- a/benchmark/space/draw.py +++ b/benchmark/space/draw.py @@ -9,7 +9,6 @@ from ..submission.client import CommunicationError from . import G - WELCOME_TEXT = "Run the Quick Benchmark on the selected device to " \ "get a fast measurement of your hardware's performance.\n" \ "Usually takes less than 30 minutes." @@ -84,6 +83,7 @@ def benchmark_draw_post_pixel(arg1, arg2): result_platform = G.result_platform result_stats = G.result_stats result_dict = G.result_dict + submission_exception = G.submission_exception ui_scale = bpy.context.user_preferences.system.ui_scale blf.color(font_id, 1.0, 1.0, 1.0, 1.0) @@ -219,12 +219,18 @@ def _draw_benchmark_has_run(image_y, ui_scale, window_width, window_height): def _after_submission_text() -> str: + import requests.exceptions ex = G.submission_exception # Nothing wrong, just show the default text. if not ex: return BLURB_TEXT + # Generic message when we cannot reach MyData. + if isinstance(ex, requests.exceptions.ConnectionError): + return f'Unable to connect to the Open Data platform. ' \ + f'Please check your internet connection and try again.' + # If not our own exception class, show generic message. if not isinstance(ex, CommunicationError): return f'Error submitting your results: {ex}'