changeset 1051:d9b5370da3fe

add: better vulkan exception handling
author sam <sam@basx.dev>
date Fri, 29 Mar 2024 16:28:30 +0700
parents 47a6fc0df3a9
children b8d20f75ecef
files semicongine/vulkan/instance.nim
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/semicongine/vulkan/instance.nim	Fri Mar 29 16:01:53 2024 +0700
+++ b/semicongine/vulkan/instance.nim	Fri Mar 29 16:28:30 2024 +0700
@@ -109,8 +109,8 @@
 
   log LEVEL_MAPPING[messageSeverity], &"{toEnums messageTypes}: {pCallbackData.pMessage}"
   if messageSeverity == VK_DEBUG_UTILS_MESSAGE_SEVERITY_ERROR_BIT_EXT:
-    echo getStackTrace()
-    quit()
+    let errorMsg = getStackTrace() & &"\n{toEnums messageTypes}: {pCallbackData.pMessage}"
+    raise newException(Exception, errorMsg)
   return false
 
 proc createDebugMessenger*(