title: HAProxy not returning error in TCP mode
body: <p>I have HAProxy routing to a list of PostgreSQL machines. When a host has PostgreSQL turned on, I can successfully connect using the line below. With PostgreSQL off on all hosts, I am expecting to see an error message from HAProxy, something along the lines of 'Connection refused', but not seeing anything... Here is my example config:</p>
  
  <pre><code>global
  
      log             127.0.0.1 local4 debug
      chroot      /var/lib/haproxy
      pidfile     /var/run/haproxy.pid
      maxconn     4000
      user        haproxy
      group       haproxy
      daemon
  
  defaults
      mode                    tcp
      log                     global
      option                  tcplog
      option                  dontlognull
      option                  redispatch
      retries                 3
      timeout queue           1m
      timeout connect         10s
      timeout client          1m
      timeout server          1m
      timeout check           10s
      maxconn                 3000
  
  frontend cluster01
      bind *:33300
      mode tcp
      option tcplog
      default_backend cluster01
  
  backend cluster01
      mode tcp
      option tcplog
      balance     roundrobin
      server host1 &lt;host ip&gt;:5432 check
      server host2 &lt;host ip&gt;:5432 check
  </code></pre>
  
  <p>Here is the command I am attempting to execute:</p>
  
  <pre><code>psql -U postgres -d &lt;dbname&gt; -p 33300 -h 127.0.0.1
  </code></pre>
  
  <p>Here is the 'response':</p>
  
  <pre><code>psql: 
  </code></pre>
  
  <p>Here is the entry in syslog:</p>
  
  <pre><code>2014-05-28T21:17:15.486474+00:00 localhost.localdomain [info] haproxy[28503]: 127.0.0.1:58014 [28/May/2014:21:16:55.170] cluster01 cluster01/&lt;NOSRV&gt; -1/-1/0 0 SC 0/0/0/0/0 0/0
  </code></pre>
  
  <p>Two questions:</p>
  
  <ol>
  <li><p>Does my configuration look ok for logging errors?</p></li>
  <li><p>Does HAProxy support personalized error messages for TCP connections? I notice that upon particular HTTP response codes, HAProxy supports <em>errorfile</em> entries, but I see no such mention of this for anything related to TCP... am I wrong?</p></li>
  </ol>
  
  <p>Any questions don't hesitate to ask</p>