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

Http Client (Timeout)

Discussion in 'XenForo Development Discussions' started by Robust, Oct 27, 2015.

  1. Robust

    Robust Well-Known Member

    An exception occurred: Unable to Connect to ssl://www.apantic.com:443. Error #110: Connection timed out in /home/vagrant/apantic/dev1/library/Zend/Http/Client/Adapter/Socket.php on line 235
    I get that error if apantic.com is ever down or if XF is unable to connect. I checked XenForo_Helper_Http and there are a bunch of 'safe' options, but none to say if you can't connect 5 times just return null or whatever. Instead it returns a XF error.

    Is there any way to set a maxtries and in which case it returns false or null or something?
  2. Jake B.

    Jake B. Well-Known Member

    You can wrap it in a try and catch any exceptions and handle it from there
  3. Robust

    Robust Well-Known Member

    Could try that. Might have a timeout but still a good idea.

    That's the exception it'd call if it had problems, right?
  4. Jake B.

    Jake B. Well-Known Member

    Probably, but it might be a good idea to have it catch all exceptions just to prevent potential page breaking. Iirc you can pass a timeout to it as well, don't remember how though, I can look later if you don't figure it out. On mobile now
    Robust likes this.

Share This Page