@@ -106,7 +106,7 @@ public ValueTask<int> Error(LuaFunctionExecutionContext context, Memory<LuaValue
106106 ? "(error object is a nil value)"
107107 : context . Arguments [ 0 ] ;
108108
109- throw new LuaRuntimeLuaValueException ( context . State . GetTraceback ( ) , value ) ;
109+ throw new LuaRuntimeException ( context . State . GetTraceback ( ) , value ) ;
110110 }
111111
112112 public ValueTask < int > GetMetatable ( LuaFunctionExecutionContext context , Memory < LuaValue > buffer , CancellationToken cancellationToken )
@@ -156,7 +156,7 @@ public ValueTask<int> IPairs(LuaFunctionExecutionContext context, Memory<LuaValu
156156 buffer . Span [ 2 ] = 0 ;
157157 return new ( 3 ) ;
158158 }
159-
159+
160160 public async ValueTask < int > LoadFile ( LuaFunctionExecutionContext context , Memory < LuaValue > buffer , CancellationToken cancellationToken )
161161 {
162162 // Lua-CSharp does not support binary chunks, the mode argument is ignored.
@@ -240,7 +240,7 @@ public ValueTask<int> Next(LuaFunctionExecutionContext context, Memory<LuaValue>
240240 return new ( 1 ) ;
241241 }
242242 }
243-
243+
244244 public ValueTask < int > Pairs ( LuaFunctionExecutionContext context , Memory < LuaValue > buffer , CancellationToken cancellationToken )
245245 {
246246 var arg0 = context . GetArgument < LuaTable > ( 0 ) ;
@@ -285,9 +285,9 @@ public async ValueTask<int> PCall(LuaFunctionExecutionContext context, Memory<Lu
285285 catch ( Exception ex )
286286 {
287287 buffer . Span [ 0 ] = false ;
288- if ( ex is LuaRuntimeLuaValueException luaEx )
288+ if ( ex is LuaRuntimeException { ErrorObject : not null } luaEx )
289289 {
290- buffer . Span [ 1 ] = luaEx . Value ;
290+ buffer . Span [ 1 ] = luaEx . ErrorObject . Value ;
291291 }
292292 else
293293 {
@@ -360,7 +360,7 @@ public ValueTask<int> RawSet(LuaFunctionExecutionContext context, Memory<LuaValu
360360 arg0 [ arg1 ] = arg2 ;
361361 return new ( 0 ) ;
362362 }
363-
363+
364364 public ValueTask < int > Select ( LuaFunctionExecutionContext context , Memory < LuaValue > buffer , CancellationToken cancellationToken )
365365 {
366366 var arg0 = context . GetArgument ( 0 ) ;
@@ -398,7 +398,7 @@ public ValueTask<int> Select(LuaFunctionExecutionContext context, Memory<LuaValu
398398 return default ;
399399 }
400400 }
401-
401+
402402 public ValueTask < int > SetMetatable ( LuaFunctionExecutionContext context , Memory < LuaValue > buffer , CancellationToken cancellationToken )
403403 {
404404 var arg0 = context . GetArgument < LuaTable > ( 0 ) ;
@@ -567,7 +567,7 @@ public ValueTask<int> ToString(LuaFunctionExecutionContext context, Memory<LuaVa
567567 var arg0 = context . GetArgument ( 0 ) ;
568568 return arg0 . CallToStringAsync ( context , buffer , cancellationToken ) ;
569569 }
570-
570+
571571 public ValueTask < int > Type ( LuaFunctionExecutionContext context , Memory < LuaValue > buffer , CancellationToken cancellationToken )
572572 {
573573 var arg0 = context . GetArgument ( 0 ) ;
@@ -613,8 +613,8 @@ public async ValueTask<int> XPCall(LuaFunctionExecutionContext context, Memory<L
613613 catch ( Exception ex )
614614 {
615615 methodBuffer . AsSpan ( ) . Clear ( ) ;
616- var error = ( ex is LuaRuntimeLuaValueException luaEx ) ? luaEx . Value : ex . Message ;
617-
616+ var error = ex is LuaRuntimeException { ErrorObject : not null } luaEx ? luaEx . ErrorObject . Value : ex . Message ;
617+
618618 context . State . Push ( error ) ;
619619
620620 // invoke error handler
@@ -627,7 +627,7 @@ await arg1.InvokeAsync(context with
627627
628628 buffer . Span [ 0 ] = false ;
629629 buffer . Span [ 1 ] = methodBuffer [ 0 ] ;
630-
630+
631631
632632 return 2 ;
633633 }
0 commit comments