File tree Expand file tree Collapse file tree 3 files changed +15
-6
lines changed Expand file tree Collapse file tree 3 files changed +15
-6
lines changed Original file line number Diff line number Diff line change @@ -40,9 +40,12 @@ Local<Object> DeviceClass::newDevice(Player* p) {
4040
4141// 成员函数
4242void DeviceClass::setPlayer (Player* player) {
43- __try {
43+ try {
4444 id = player->getOrCreateUniqueID ();
45- } __except (EXCEPTION_EXECUTE_HANDLER) {
45+ } catch (...) {
46+ lse::getSelfPluginInstance ().getLogger ().error (" Fail in DeviceClass::setPlayer" );
47+ ll::error_utils::printCurrentException (lse::getSelfPluginInstance ().getLogger ());
48+ LOG_ERROR_WITH_SCRIPT_INFO ();
4649 isValid = false ;
4750 }
4851}
Original file line number Diff line number Diff line change @@ -208,9 +208,12 @@ std::optional<Actor*> EntityClass::tryExtractActor(Local<Value> v) {
208208
209209// 成员函数
210210void EntityClass::set (Actor* actor) {
211- __try {
211+ try {
212212 id = actor->getOrCreateUniqueID ();
213- } __except (EXCEPTION_EXECUTE_HANDLER) {
213+ } catch (...) {
214+ lse::getSelfPluginInstance ().getLogger ().error (" Fail in EntityClass::set" );
215+ ll::error_utils::printCurrentException (lse::getSelfPluginInstance ().getLogger ());
216+ LOG_ERROR_WITH_SCRIPT_INFO ();
214217 isValid = false ;
215218 }
216219}
Original file line number Diff line number Diff line change @@ -648,9 +648,12 @@ Local<Value> McClass::broadcast(const Arguments& args) {
648648
649649// 成员函数
650650void PlayerClass::set (Player* player) {
651- __try {
651+ try {
652652 id = player->getOrCreateUniqueID ();
653- } __except (EXCEPTION_EXECUTE_HANDLER) {
653+ } catch (...) {
654+ lse::getSelfPluginInstance ().getLogger ().error (" Fail in PlayerClass::set" );
655+ ll::error_utils::printCurrentException (lse::getSelfPluginInstance ().getLogger ());
656+ LOG_ERROR_WITH_SCRIPT_INFO ();
654657 isValid = false ;
655658 }
656659}
You can’t perform that action at this time.
0 commit comments