Fixes assert not throwing exceptions for PkmnLibAI, now always throws exceptions if non-zero response.
This commit is contained in:
parent
12850e3771
commit
3cb243175c
|
@ -23,6 +23,16 @@ namespace PkmnLibSharp.Utilities
|
||||||
var stack = Pkmnlib.Generated.C.GetLastExceptionStacktrace().PtrString();
|
var stack = Pkmnlib.Generated.C.GetLastExceptionStacktrace().PtrString();
|
||||||
throw new NativeException("PkmnLib", message, stack);
|
throw new NativeException("PkmnLib", message, stack);
|
||||||
}
|
}
|
||||||
|
case 5:
|
||||||
|
{
|
||||||
|
var message = PkmnLibAI.Generated.C.GetLastException().PtrString()!;
|
||||||
|
var stack = PkmnLibAI.Generated.C.GetLastExceptionStacktrace().PtrString();
|
||||||
|
throw new NativeException("PkmnLibAI", message, stack);
|
||||||
|
}
|
||||||
|
default:
|
||||||
|
{
|
||||||
|
throw new NativeException("Undefined", "", "");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue