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

XF 2.0 Best way to return a generic error to the end user?

Jaxel

Well-known member
#1
In XF1, when I wanted to return a generic error to the end user, I used a throw exception:
Code:
throw new XenForo_Exception(new XenForo_Phrase('channel_url_did_not_match_services'), true);
Yeah, I know... probably not the most proper way to do things. But it worked very nicely.

Throwing exceptions in XF2 aren't really an option anymore, because exceptions XF2 aren't really generic anymore and also dump traces. What would be the best way to return generic errors to the end user in XF2 from a repository?