title: JSF2.0 - Handling erroneous Ajax calls with Primefaces 3.0
body: <p>I have a <code>commandButton</code> in my .xhtml page:</p>
  
  <pre><code>&lt;p:commandButton action="#{someone.doSomething()}"
                  ajax="true"
                  onerror="errorDialog.show();"&gt;
  &lt;/p:commandButton&gt;
  </code></pre>
  
  <p>It's simply making an Ajax call. How can I detect situations such as internet connection problem (of the client/browser), timeout, session-timeout, server-side exceptions, crashes etc in the middle of an Ajax call so as to show an informative message to the user? </p>
  
  <p>Does the <code>onerror</code> attribute of <code>p:ajax</code> handle all of those? If not, then what? :)
  What's the default timeout btw?</p>
  
  <p>Any help appreciated, thanks.</p>