YAFLogo

johnk
  • johnk
  • 74.8% (Friendly)
  • YAF All-the-Time Topic Starter
11 years ago
YAF uses few third party plugins (recapthca, geolocation, fb, twitter). Can we

(1) Put all this third party plugin in try catch block. This is in case the plugin is down or there is some other problem (authentication, network, API, etc), YAF code would continue to function normally (without redirecting to error.aspx page)

(2) In the catch block set up event logging. This will tell us when there is a problem with any third party plugin.

Example: Let us assume Twitter plugging is not working correctly. Per the latest fix, the login page is loading correctly (since it has try catch block for twitter), but it doesnt tell us why the twitter is not loading. Having this logged will be very helpful.

Sponsor
tha_watcha
  • tha_watcha
  • 100% (Exalted)
  • YAF.NET Project Lead 🤴 YAF Version: 4.0.1 BETA
11 years ago
This would be a great solution. The problem is there are some many things that can go wrong it's not always possible to log the error correctly. In your twitter example where the URL is wrong and the twitter API didn't return that the URL is wrong it simply return an authorization request denied. Which if we log it in yaf this would not help to solve the problem.
johnk
  • johnk
  • 74.8% (Friendly)
  • YAF All-the-Time Topic Starter
11 years ago

This would be a great solution. The problem is there are some many things that can go wrong it's not always possible to log the error correctly. In your twitter example where the URL is wrong and the twitter API didn't return that the URL is wrong it simply return an authorization request denied. Which if we log it in yaf this would not help to solve the problem.

Originally Posted by: tha_watcha 

I agree, there may be many errors (known and unknown) when dealing with third party code.

How about we log a very generic error message:


YAF encountered an error when loading Twitter plugin. The error occurrred in \pages\register.ascx line 117.

This would tell forum Admin that twitter is now erroring out. They can remove the try-catch block in that file (and line number mentioned above) and see what the error is and resolve the issue.

Currently if twitter changes API in few weeks, forum Admin would not know that the API is broken, since it will not show any error message.

johnk
  • johnk
  • 74.8% (Friendly)
  • YAF All-the-Time Topic Starter
11 years ago
Thank you the_watcha for implementing the error log for twitter.

Is it possible to do the same for other plugins (FB, blogspam, geolocation, etc)

Facebook is famous for breaking their API. So adding them in try catch block would be very helpful. :lol: