1. 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...

Discussion in 'Closed Suggestions' started by Liam W, Nov 20, 2014.

  1. Liam W

    Liam W Well-Known Member

    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
     
  2. Chris D

    Chris D XenForo Developer Staff Member

    Why don't you catch exceptions thrown in the add-on uninstall method?
     
    Brogan likes this.
  3. Daniel Hood

    Daniel Hood Well-Known Member

    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 likes this.
  4. Liam W

    Liam W Well-Known Member

    Pretty much what I was thinking.

    Like I said, it was just a random thought.

    Crumbs, I can't delete threads...
     
    Daniel Hood likes this.
  5. Chris D

    Chris D XenForo Developer Staff Member

    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.
     
    Liam W and Daniel Hood like this.

Share This Page