HBASE-22123 REST gateway reports Insufficient permissions exceptions as 404 Not Found

This commit is contained in:
Tomas Sokorai 2019-03-28 12:23:49 -07:00 committed by stack
parent 7d8de55d53
commit 541f223de4
1 changed files with 5 additions and 0 deletions

View File

@ -26,6 +26,7 @@ import java.util.NoSuchElementException;
import org.apache.hadoop.hbase.Cell; import org.apache.hadoop.hbase.Cell;
import org.apache.hadoop.hbase.CellUtil; import org.apache.hadoop.hbase.CellUtil;
import org.apache.hadoop.hbase.DoNotRetryIOException; import org.apache.hadoop.hbase.DoNotRetryIOException;
import org.apache.hadoop.hbase.security.AccessDeniedException;
import org.apache.hadoop.hbase.client.Get; import org.apache.hadoop.hbase.client.Get;
import org.apache.hadoop.hbase.client.Result; import org.apache.hadoop.hbase.client.Result;
import org.apache.hadoop.hbase.client.Table; import org.apache.hadoop.hbase.client.Table;
@ -78,6 +79,10 @@ public class RowResultGenerator extends ResultGenerator {
// help to avoid confusion by leaving a record of what happened here in // help to avoid confusion by leaving a record of what happened here in
// the log. // the log.
LOG.warn(StringUtils.stringifyException(e)); LOG.warn(StringUtils.stringifyException(e));
// Lets get the exception rethrown to get a more meaningful error message than 404
if (e instanceof AccessDeniedException) {
throw e;
}
} finally { } finally {
table.close(); table.close();
} }