Browse Source

Added error reason to failed plugin loading.

(cherry picked from commit e0e1c68aa8eec8e1ad0b3f7ceb19a9b4c304bc33)

(cherry picked from commit e0e1c68aa8eec8e1ad0b3f7ceb19a9b4c304bc33)
Matt Benic 10 years ago
parent
commit
3c5a20d409
1 changed files with 6 additions and 2 deletions
  1. 6 2
      Source/AtomicJS/Javascript/JSPlugin.cpp

+ 6 - 2
Source/AtomicJS/Javascript/JSPlugin.cpp

@@ -26,7 +26,9 @@ namespace Atomic
 
         if (handle == NULL)
         {
-            errorMsg = ToString("Native Plugin: Unable to load %s", pluginLibrary.CString());
+            errorMsg = ToString("Native Plugin: Unable to load %s with error %s", 
+                pluginLibrary.CString(),
+                SDL_GetError());
             return false;
         }
 
@@ -86,7 +88,9 @@ namespace Atomic
         if (duk_pcall(ctx, 1) != DUK_EXEC_SUCCESS)
         {
             success = false;
-            LOGERRORF("Native Plugin: error calling atomic_plugin_init %s", pluginLibrary.CString());
+            LOGERRORF("Native Plugin: error calling atomic_plugin_init %s with error %s", 
+                pluginLibrary.CString(), 
+                duk_safe_to_string(ctx, -1));
         }
         else
         {