Handle lua -> C# function invocation exceptions more gracefully

This commit is contained in:
Deukhoofd 2018-11-23 13:34:21 +01:00
parent d6e18d9b0c
commit 8d6d6e45af
No known key found for this signature in database
GPG Key ID: B4C087AC81641654
1 changed files with 10 additions and 1 deletions

View File

@ -75,7 +75,16 @@ namespace Upsilon.BaseTypes
objects.Add(null);
}
}
try
{
return method.Invoke(_object, objects.ToArray()).ToLuaType();
}
catch (TargetInvocationException e)
{
if (e.InnerException != null) throw e.InnerException;
throw;
}
}
}
}