Gamestudio Links
Zorro Links
Newest Posts
AlpacaZorroPlugin v1.3.0 Released
by kzhao. 05/22/24 13:41
Free Live Data for Zorro with Paper Trading?
by AbrahamR. 05/18/24 13:28
Change chart colours
by 7th_zorro. 05/11/24 09:25
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
1 registered members (Akow), 1,365 guests, and 7 spiders.
Key: Admin, Global Mod, Mod
Newest Members
AemStones, LucasJoshua, Baklazhan, Hanky27, firatv
19055 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
adding an error-case function #274928
06/29/09 09:06
06/29/09 09:06
Joined: Feb 2006
Posts: 1,011
Germany
pegamode Offline OP
Serious User
pegamode  Offline OP
Serious User

Joined: Feb 2006
Posts: 1,011
Germany
Hi,

would it be possible to add a function that is called whenever an error occurs?

For example there would be a function prototype errorFct() that could be overridden by an implementation and is called whenever an error occurs so that we could add some additional debugging code. It would be great if that function could be called before the error popup is displayed.

Regards,
Pegamode.

Re: adding an error-case function [Re: pegamode] #274935
06/29/09 10:06
06/29/09 10:06
Joined: Jul 2000
Posts: 27,986
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,986
Frankfurt
I don't know a situation where an error handler would make much sense. Errors are caused either by bugs in the script, or by wrong external files. Bugs in the script must be fixed; an error handling function won't help better than the error message. Script crashes are caught with the C++ "try/catch" mechanism, which won't give you more info about the crash as you already have in the error message.

Wrong or missing external files normally won't cause an error message unless they are essential for continuing the program. Otherwise, the function using them just returns an error value, usually 0, that you can evaluate in the script. A general error handler for this type of errors will tell you less than when you evaluate the return values.

Re: adding an error-case function [Re: jcl] #274936
06/29/09 10:15
06/29/09 10:15
Joined: Sep 2003
Posts: 9,859
F
FBL Offline
Senior Expert
FBL  Offline
Senior Expert
F

Joined: Sep 2003
Posts: 9,859
a try/catch is always useful when working with data coming from external, like e.g. parsing a file.

I really missed a try/catch mechanism when I wrote my XML parser in Lite-C...

Re: adding an error-case function [Re: FBL] #274937
06/29/09 10:29
06/29/09 10:29
Joined: Feb 2006
Posts: 1,011
Germany
pegamode Offline OP
Serious User
pegamode  Offline OP
Serious User

Joined: Feb 2006
Posts: 1,011
Germany
I agree: "Bugs in the script must be fixed" ... but that's the point. I think such an error handler could help to analyze the error and with that to fix it.
For example sometimes it would be very useful to get a list of all currently running functions when an error occurs. This could be done in such an error handler function.

b.t.w. a try/catch mechanism in lite-c would be great, too.

Last edited by pegamode; 06/29/09 11:04.
Re: adding an error-case function [Re: pegamode] #275466
07/01/09 12:40
07/01/09 12:40
Joined: Jul 2008
Posts: 894
T
TechMuc Offline
User
TechMuc  Offline
User
T

Joined: Jul 2008
Posts: 894
Please implement such an on_error method!
This would allow to work out a stackwalk to catch eventual DLL-Errors with the correct(!!) function name.


Moderated by  aztec, Spirit 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1