Replace 404 with HttpURLConnection.HTTP_NOT_FOUND
This commit is contained in:
parent
248845638a
commit
8ea9951e1a
|
@ -33,6 +33,7 @@ import org.elasticsearch.common.logging.ESLoggerFactory;
|
||||||
import java.io.FileNotFoundException;
|
import java.io.FileNotFoundException;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
|
import java.net.HttpURLConnection;
|
||||||
import java.net.URISyntaxException;
|
import java.net.URISyntaxException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -97,7 +98,7 @@ public class AbstractAzureBlobContainer extends AbstractBlobContainer {
|
||||||
is.close();
|
is.close();
|
||||||
listener.onCompleted();
|
listener.onCompleted();
|
||||||
} catch (ServiceException e) {
|
} catch (ServiceException e) {
|
||||||
if (e.getHttpStatusCode() == 404) {
|
if (e.getHttpStatusCode() == HttpURLConnection.HTTP_NOT_FOUND) {
|
||||||
listener.onFailure(new FileNotFoundException(e.getMessage()));
|
listener.onFailure(new FileNotFoundException(e.getMessage()));
|
||||||
} else {
|
} else {
|
||||||
listener.onFailure(e);
|
listener.onFailure(e);
|
||||||
|
|
Loading…
Reference in New Issue