1
0
mirror of https://github.com/VCMP-SqMod/SqMod.git synced 2024-11-08 08:47:17 +01:00

Catch more exception types.

This commit is contained in:
Sandu Liviu Catalin 2021-01-31 18:48:49 +02:00
parent fd2a1de107
commit dcf35782d1

View File

@ -382,10 +382,10 @@ int32_t Controller::Exec(Context & ctx)
{
result = ctx.mInstance->Execute(ctx.mInvoker, args);
}
catch (const Sqrat::Exception & e)
catch (const std::exception & e)
{
// Let's store the exception message
ctx.mBuffer.Write(0, e.what(), static_cast< Buffer::SzType >(e.Message().size()));
ctx.mBuffer.WriteS(0, e.what());
// Specify that the command execution failed
failed = true;
}
@ -404,10 +404,10 @@ int32_t Controller::Exec(Context & ctx)
{
result = ctx.mInstance->Execute(ctx.mInvoker, args);
}
catch (const Sqrat::Exception & e)
catch (const std::exception & e)
{
// Let's store the exception message
ctx.mBuffer.Write(0, e.what(), static_cast< Buffer::SzType >(e.Message().size()));
ctx.mBuffer.WriteS(0, e.what());
// Specify that the command execution failed
failed = true;
}