Return-Path: X-Original-To: apmail-hc-dev-archive@www.apache.org Delivered-To: apmail-hc-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 669EE10315 for ; Sun, 25 Jan 2015 20:28:34 +0000 (UTC) Received: (qmail 20178 invoked by uid 500); 25 Jan 2015 20:28:34 -0000 Delivered-To: apmail-hc-dev-archive@hc.apache.org Received: (qmail 20134 invoked by uid 500); 25 Jan 2015 20:28:34 -0000 Mailing-List: contact dev-help@hc.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "HttpComponents Project" Delivered-To: mailing list dev@hc.apache.org Received: (qmail 20123 invoked by uid 99); 25 Jan 2015 20:28:34 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 25 Jan 2015 20:28:34 +0000 Date: Sun, 25 Jan 2015 20:28:34 +0000 (UTC) From: "Oleg Kalnichevski (JIRA)" To: dev@hc.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Comment Edited] (HTTPCLIENT-1602) Tutorial claims that HttpException is unrecoverable but the implementation is recoverable MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/HTTPCLIENT-1602?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14291255#comment-14291255 ] Oleg Kalnichevski edited comment on HTTPCLIENT-1602 at 1/25/15 8:28 PM: ------------------------------------------------------------------------ Because there is _nothing_ that mandates that it has to be unchecked. Certain HttpException instances can well be recoverable. They however cannot be recovered from _automatically_ simply by retrying the request without some exception handling logic. Oleg was (Author: olegk): Because there is _nothing_ that mandates that it has to be unchecked. Certain HttpException instances can well be recoverable. They however cannot be recovered from _automatically_ simply by retrying the request with some exception handling logic. Oleg > Tutorial claims that HttpException is unrecoverable but the implementation is recoverable > ----------------------------------------------------------------------------------------- > > Key: HTTPCLIENT-1602 > URL: https://issues.apache.org/jira/browse/HTTPCLIENT-1602 > Project: HttpComponents HttpClient > Issue Type: Bug > Components: Documentation, HttpClient > Affects Versions: 4.3.6, 4.4 Beta1 > Reporter: Michael Osipov > > According to the [chapter 1.4|http://hc.apache.org/httpcomponents-client-ga/tutorial/html/fundamentals.html#d5e271] of the tutorial the {{HttpException}} and every derived one is unrecoverable. If you open up the [Javadoc|http://hc.apache.org/httpcomponents-core-ga/httpcore/apidocs/org/apache/http/HttpException.html?is-external=true] for, you'll see that is extends {{java.lang.Exception}}. This is wrong, unrecoverable exceptions always extend from {{java.lang.RuntimeException}} to indicate its nature which is an unchecked exception. > See [this|http://ted-gao.blogspot.de/2013/03/best-practices-in-java-exception.html], paragraph *Checked or Unckecked Exception*. It ultimately refers to Effective Java, Item 58: Use checked exceptions for recoverable conditions and runtime exceptions for programming errors and Item 59: Avoid unnecessary use of checked exceptions. -- This message was sent by Atlassian JIRA (v6.3.4#6332) --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org For additional commands, e-mail: dev-help@hc.apache.org