• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

Not planned Catch exceptions in add-on uninstall method...

Liam W

Well-known member
#1
Just a random thought I had the other day while reading the code...

Why don't you catch exceptions thrown in the add-on uninstall method? That way then uninstall process can never be blocked...

The only caveat is it'll still run if genuine errors are encountered... However you could rethrow any exceptions that aren't classed as user printable...

Anyhow, just a random idea.

Liam
 

Daniel Hood

Well-known member
#3
If there's a legitimate issue with the uninstall function then the add on's tables will not be deleted, nor will data be deleted. It's much better for it to error, be reported, and be fixed. Making it error silently would result in the admin thinking the add on is deleted, when it's not.
 

Liam W

Well-known member
#4
If there's a legitimate issue with the uninstall function then the add on's tables will not be deleted, nor will data be deleted. It's much better for it to error, be reported, and be fixed. Making it error silently would result in the admin thinking the add on is deleted, when it's not.
Pretty much what I was thinking.

Like I said, it was just a random thought.

Crumbs, I can't delete threads...
 

Chris D

XenForo developer
Staff member
#5
We'll probably just consider this a "No Thanks" for now :)

Aside from you already being able to catch exceptions yourself and act accordingly, as stated by Daniel there's likely cases where you would legitimately the process to be halted.

There are valid reasons to catch exceptions, too, of course, but you should be in control of those when necessary.