YAFLogo

johnk
  • johnk
  • 74.8% (Friendly)
  • YAF All-the-Time Topic Starter
10 years ago
Is it possible to put all third party code in try and catch block. This way if they change API in future, it would not stop YAF from working.

Here are the third party code I know:

1. Detecting blogspam/bots
2. GeoLocation
3. FB login
4. Twitter login
5. Google login

The first two are important. For first one if API is changed, users may not be able to post at all. For second one, if API is changed, user may not be able to register to the site. System could be redirecting to default error page without try and catch block.
Sponsor

tha_watcha
  • tha_watcha
  • 100% (Exalted)
  • YAF.NET Project Lead 🤴 YAF Version: 3.0.3
10 years ago
Originally Posted by: johnk 

Is it possible to put all third party code in try and catch block. This way if they change API in future, it would not stop YAF from working.



Yes this is already done. Everything will also be logged in the event log.
johnk
  • johnk
  • 74.8% (Friendly)
  • YAF All-the-Time Topic Starter
10 years ago
In /pages/register.ascx.cs

Line 590 - 630: I noticed they are not currently in try and catch block.

If they change variable name (cityname to city, regionname to region, etc) in future, the registration page would not load.
tha_watcha
  • tha_watcha
  • 100% (Exalted)
  • YAF.NET Project Lead 🤴 YAF Version: 3.0.3
10 years ago
Originally Posted by: johnk 

In /pages/register.ascx.cs

Line 590 - 630: I noticed they are not currently in try and catch block.

If they change variable name (cityname to city, regionname to region, etc) in future, the registration page would not load.



i added checks if the columns exists, add some point the code should be rewritten to json to make it easier to handle this. But now it should always work.
YAF Logo Copyright © YetAnotherForum.NET & Ingo Herbote. All rights reserved
About Us

The YAF.NET is an open source .NET forum project. YAF.NET is supported by an team of international developers who are build community by building community software.

Powered by Resharper Donate with PayPal button