Fix exc handling
This commit is contained in:
parent
3ffd1a5219
commit
deaf8884e9
|
@ -20,7 +20,6 @@
|
||||||
package org.elasticsearch.repositories.hdfs;
|
package org.elasticsearch.repositories.hdfs;
|
||||||
|
|
||||||
import org.apache.hadoop.fs.FileContext;
|
import org.apache.hadoop.fs.FileContext;
|
||||||
import org.elasticsearch.ElasticsearchException;
|
|
||||||
import org.elasticsearch.SpecialPermission;
|
import org.elasticsearch.SpecialPermission;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
@ -49,17 +48,7 @@ final class SecurityUtils {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} catch (PrivilegedActionException pae) {
|
} catch (PrivilegedActionException pae) {
|
||||||
Throwable th = pae.getCause();
|
throw (IOException) pae.getException();
|
||||||
if (th instanceof Error) {
|
|
||||||
throw (Error) th;
|
|
||||||
}
|
|
||||||
if (th instanceof RuntimeException) {
|
|
||||||
throw (RuntimeException) th;
|
|
||||||
}
|
|
||||||
if (th instanceof IOException) {
|
|
||||||
throw (IOException) th;
|
|
||||||
}
|
|
||||||
throw new ElasticsearchException(pae);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue