Dear forum users! In compliance with the new European GDPR regulations, we'd just like to inform you that if you have an account, your email address is stored in our database. We do not share your information with third parties, and your email address and password are encrypted for security reasons.

New to the forum? Say hello in this topic! Also make sure to read the rules.

How to catch the exception in callback

Share questions, scripts and tutorials related to the ScriptAPI in SFD.
Forum rules
By using the forum you agree to the following rules.
Post Reply
NearHuscarl
Superfighter
Superfighter
Posts: 97
Joined: Thu Feb 07, 2019 4:36 am

How to catch the exception in callback

Post by NearHuscarl » Sun Mar 08, 2020 6:23 pm

I want to log the stacktrace of the exception when thown in async callbacks. Is it possible to do that?
0 x
Image

User avatar
Gurt
Lead Programmer
Lead Programmer
Posts: 1884
Joined: Sun Feb 28, 2016 3:22 pm
Title: Lead programmer
Started SFD: Made it!
Location: Sweden
Gender:
Age: 34

Post by Gurt » Mon Mar 09, 2020 8:35 pm

You want wrap any of your own code in try-catch blocks if you want and handle the exception however you want in your own code.
0 x
Gurt

NearHuscarl
Superfighter
Superfighter
Posts: 97
Joined: Thu Feb 07, 2019 4:36 am

Post by NearHuscarl » Tue Mar 10, 2020 3:45 am

I just tested again in the map editor and it prints the stacktrace now. I made this post because the last time the game crashed It just printed something like error in method ScriptCallbackEvent_Update without the stacktrace. I already wrapped the whole script in a try/catch though.
0 x
Image

Post Reply