Skip to content

Commit

Permalink
fix(DaedaluScript): add more better error handling
Browse files Browse the repository at this point in the history
  • Loading branch information
lmichaelis committed Jan 26, 2025
1 parent 0887eb1 commit 7ca8863
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/DaedalusScript.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
#include "zenkit-capi/DaedalusScript.h"
#include "Internal.hh"

#include <exception>
#include <zenkit/addon/daedalus.hh>

ZKC_LOADER(ZkDaedalusScript)
Expand Down Expand Up @@ -106,8 +107,9 @@ ZkDaedalusInstance* ZkDaedalusSymbol_getInstance(ZkDaedalusSymbol* slf) {

try {
auto& instance = slf->get_instance();
if (instance == nullptr) return nullptr;
return new ZkDaedalusInstance(instance);
} catch (std::runtime_error& e) {
} catch (std::exception& e) {
return nullptr;
}
}
Expand Down Expand Up @@ -193,6 +195,9 @@ ZkDaedalusDataType ZkDaedalusSymbol_getReturnType(ZkDaedalusSymbol const* slf) {
}

ZKC_API ZkDaedalusInstanceType ZkDaedalusInstance_getType(ZkDaedalusInstance const* slf) {
ZKC_TRACE_FN();
ZKC_CHECK_NULL(slf);

auto type = SLF->instance_type();

if (type == &typeid(zenkit::IGuildValues)) return ZkDaedalusInstanceType_GuildValues;
Expand Down

0 comments on commit 7ca8863

Please sign in to comment.