mirror of https://github.com/apache/druid.git
Added error message for UOE
This commit is contained in:
parent
3118160387
commit
7e49d47391
|
@ -46,7 +46,8 @@ public class QueryInterruptedException extends RuntimeException
|
|||
public static final String QUERY_TIMEOUT = "Query timeout";
|
||||
public static final String QUERY_CANCELLED = "Query cancelled";
|
||||
public static final String RESOURCE_LIMIT_EXCEEDED = "Resource limit exceeded";
|
||||
public static final String UNAUTHORIZED = "Unauthorized request.";
|
||||
public static final String UNAUTHORIZED = "Unauthorized request";
|
||||
public static final String UNSUPPORTED_OPERATION = "Unsupported operation";
|
||||
public static final String UNKNOWN_EXCEPTION = "Unknown exception";
|
||||
|
||||
private final String errorCode;
|
||||
|
@ -135,6 +136,8 @@ public class QueryInterruptedException extends RuntimeException
|
|||
return QUERY_TIMEOUT;
|
||||
} else if (e instanceof ResourceLimitExceededException) {
|
||||
return RESOURCE_LIMIT_EXCEEDED;
|
||||
} else if (e instanceof UnsupportedOperationException) {
|
||||
return UNSUPPORTED_OPERATION;
|
||||
} else {
|
||||
return UNKNOWN_EXCEPTION;
|
||||
}
|
||||
|
|
|
@ -22,6 +22,7 @@ package org.apache.druid.query;
|
|||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import com.google.common.base.Throwables;
|
||||
import org.apache.druid.java.util.common.ISE;
|
||||
import org.apache.druid.java.util.common.UOE;
|
||||
import org.apache.druid.segment.TestHelper;
|
||||
import org.junit.Assert;
|
||||
import org.junit.Test;
|
||||
|
@ -43,6 +44,7 @@ public class QueryInterruptedExceptionTest
|
|||
Assert.assertEquals("Query cancelled", new QueryInterruptedException(new CancellationException()).getErrorCode());
|
||||
Assert.assertEquals("Query interrupted", new QueryInterruptedException(new InterruptedException()).getErrorCode());
|
||||
Assert.assertEquals("Query timeout", new QueryInterruptedException(new TimeoutException()).getErrorCode());
|
||||
Assert.assertEquals("Unsupported operation", new QueryInterruptedException(new UOE("Unsupported")).getErrorCode());
|
||||
Assert.assertEquals("Unknown exception", new QueryInterruptedException(null).getErrorCode());
|
||||
Assert.assertEquals("Unknown exception", new QueryInterruptedException(new ISE("Something bad!")).getErrorCode());
|
||||
Assert.assertEquals(
|
||||
|
|
Loading…
Reference in New Issue