|Re: How to handle error in Module_startup()? [message #1705 is a reply to message #1659]
||Mon, 16 March 2009 11:29
| Dave Russo
Registered: July 2009
Ramsey Harris wrote:|
> What is the recommended way to handle and error in
> <<Mod>>_Module_startup()? Should I raise an error? Should I create a
> local error block and pass this to other modules? Should I always return
> NOTDONE when an error occurs?
> ~ Ramsey
Since startup occurs _very_ early, before main(), it is best to _never_
fail in startup. It's very difficult for a user to determine what the
problme is when their application never makes it to main().
You can set a flag in your startup to indicate the failure and then fail
"normally" in your modules API's due to a startup problem.
If, on the other hand, it is important that the application not proceed
if the startup fails, you can call System_abort().
Powered by FUDForum
. Page generated in 0.08616 seconds