Page 1 of 1

Load & Unload

Posted: Wed Jul 18, 2012 3:47 pm
by Omega_K2
When writing the logging stuff I noticed something:


When loading an addon, the loading will succeed even if the load() function fails to execute.
When unloading an addon, the unload will fail if the unload() function raises an exception.


Shouldn't that be the other way around? Loading should not succeed if the load function contains errors.
This would cause the addon to fail loading, while load would not:

Syntax: Select all

def MyLoad():
do_something_causing_exceptions()

MyLoad()


Similarily, if the unloading fails, the addon should be removed still (so at the very least that you can load it again - right now you need to restart the server or remove it manually to get it working again)

Posted: Thu Jul 19, 2012 12:06 am
by satoon101
I'll look into that. Thanks.

Satoon

Posted: Thu Jul 19, 2012 1:09 am
by satoon101
This "should" be fixed in the newest build. Let me know if you find otherwise.

Thanks again for reporting this bug.

Satoon