From 0312c7c56ad1d84aaa74ce129ab82d6a0c748633 Mon Sep 17 00:00:00 2001 From: martinfouilleul Date: Mon, 19 Jun 2023 14:17:40 +0200 Subject: [PATCH] add an error popup and quit when the web assembly module can't load --- src/main.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/main.c b/src/main.c index 36055ae..c1c8c2e 100644 --- a/src/main.c +++ b/src/main.c @@ -321,6 +321,14 @@ void* orca_runloop(void* user) if(!file) { log_error("Couldn't load wasm module at %s\n", modulePathCString); + + char* options[] = {"OK"}; + mp_alert_popup("Error", + "The application couldn't load: web assembly module not found", + 1, + options); + + mp_request_quit(); return((void*)-1); } @@ -362,6 +370,14 @@ void* orca_runloop(void* user) m3_GetErrorInfo(app->runtime.m3Runtime, &errInfo); log_error("wasm error: %s\n", errInfo.message); + + char* options[] = {"OK"}; + mp_alert_popup("Error", + "The application couldn't load: can't compile web assembly module", + 1, + options); + + mp_request_quit(); return((void*)-1); }