Minor improvement to recon error handling
This commit is contained in:
parent
8b59e1ed5b
commit
37d8abc114
@ -34,7 +34,6 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|||||||
package com.google.refine.model.recon;
|
package com.google.refine.model.recon;
|
||||||
|
|
||||||
import java.io.DataOutputStream;
|
import java.io.DataOutputStream;
|
||||||
import java.io.IOException;
|
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
import java.io.StringWriter;
|
import java.io.StringWriter;
|
||||||
import java.net.HttpURLConnection;
|
import java.net.HttpURLConnection;
|
||||||
@ -316,11 +315,11 @@ public class StandardReconConfig extends ReconConfig {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (connection.getResponseCode() >= 400) {
|
if (connection.getResponseCode() >= 400) {
|
||||||
// TODO: Retry with backoff on 500 errors?
|
|
||||||
InputStream is = connection.getErrorStream();
|
InputStream is = connection.getErrorStream();
|
||||||
throw new IOException("Failed - code:"
|
logger.error("Failed - code:"
|
||||||
+ Integer.toString(connection.getResponseCode())
|
+ Integer.toString(connection.getResponseCode())
|
||||||
+ " message: " + is == null ? "" : ParsingUtilities.inputStreamToString(is));
|
+ " message: " + is == null ? ""
|
||||||
|
: ParsingUtilities.inputStreamToString(is));
|
||||||
} else {
|
} else {
|
||||||
InputStream is = connection.getInputStream();
|
InputStream is = connection.getInputStream();
|
||||||
try {
|
try {
|
||||||
|
Loading…
Reference in New Issue
Block a user