You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -99,15 +101,15 @@ public ThrottlingInvoker(Builder builder)
99
101
BlockSpillerspiller)
100
102
{
101
103
if (decrease > 1 || decrease < .001) {
102
-
thrownewIllegalArgumentException("decrease was " + decrease + " but should be between .001 and 1");
104
+
thrownewAthenaConnectorException("decrease was " + decrease + " but should be between .001 and 1", newErrorDetails().withErrorCode(FederationSourceErrorCode.InvalidInputException.toString()));
103
105
}
104
106
105
107
if (maxDelayMs < 1) {
106
-
thrownewIllegalArgumentException("maxDelayMs was " + maxDelayMs + " but must be >= 1");
108
+
thrownewAthenaConnectorException("maxDelayMs was " + maxDelayMs + " but must be >= 1", newErrorDetails().withErrorCode(FederationSourceErrorCode.InvalidInputException.toString()));
107
109
}
108
110
109
111
if (increase < 1) {
110
-
thrownewIllegalArgumentException("increase was " + increase + " but must be >= 1");
112
+
thrownewAthenaConnectorException("increase was " + increase + " but must be >= 1", newErrorDetails().withErrorCode(FederationSourceErrorCode.InvalidInputException.toString()));
111
113
}
112
114
113
115
this.initialDelayMs = initialDelayMs;
@@ -198,7 +200,7 @@ public <T> T invoke(Callable<T> callable, long timeoutMillis)
198
200
}
199
201
while (!isTimedOut(startTime, timeoutMillis));
200
202
201
-
thrownewTimeoutException("Timed out before call succeeded after " + (System.currentTimeMillis() - startTime) + " ms");
203
+
thrownewAthenaConnectorException("Timed out before call succeeded after " + (System.currentTimeMillis() - startTime) + " ms", newErrorDetails().withErrorCode(FederationSourceErrorCode.OperationTimeoutException.toString()));
202
204
}
203
205
204
206
/**
@@ -254,7 +256,7 @@ else if (newDelay > maxDelayMs) {
254
256
255
257
if (spillerRef.get() != null && !spillerRef.get().spilled()) {
256
258
//If no blocks have spilled, it is better to signal the Throttle to Athena by propagating.
257
-
thrownewFederationThrottleException("ThrottlingInvoker requesting slow down due to " + ex, ex);
259
+
thrownewAthenaConnectorException("ThrottlingInvoker requesting slow down due to " + ex, newErrorDetails().withErrorCode(FederationSourceErrorCode.ThrottlingException.toString()));
Copy file name to clipboardExpand all lines: athena-federation-sdk/src/main/java/com/amazonaws/athena/connector/lambda/data/AthenaFederationIpcOption.java
vector.getClass().getSimpleName() + " for field " + vector.getField().getName(), newErrorDetails().withErrorMessage(FederationSourceErrorCode.OperationNotSupportedException.toString()));
thrownewRuntimeException("Unable to set value for field " + fieldName
402
+
thrownewAthenaConnectorException("Unable to set value for field " + fieldName
400
403
+ " using value " + value
401
-
+ " of type " + vector.getMinorType(), ex);
404
+
+ " of type " + vector.getMinorType(), newErrorDetails().withErrorCode(FederationSourceErrorCode.InvalidInputException.toString()).withErrorMessage(ex.getMessage()));
thrownewIllegalArgumentException("Unknown type " + type);
1017
+
thrownewAthenaConnectorException("Unknown type " + type, newErrorDetails().withErrorCode(FederationSourceErrorCode.InvalidInputException.toString()));
1015
1018
}
1016
1019
}
1017
1020
catch (RuntimeExceptionex) {
1018
-
thrownewRuntimeException("Unable to write value for field "
1021
+
thrownewAthenaConnectorException("Unable to write value for field "
1019
1022
+ field.getName() + " using value " + value
1020
-
+ " with minor type " + Types.getMinorTypeForArrowType(type), ex);
1023
+
+ " with minor type " + Types.getMinorTypeForArrowType(type), newErrorDetails().withErrorCode(FederationSourceErrorCode.InternalServiceException.toString()).withErrorMessage(ex.getMessage()));
if (!org.apache.arrow.vector.types.TimeUnit.MILLISECOND.equals(timeunit)) {
333
-
thrownewUnsupportedOperationException("Unpacking is only supported for milliseconds");
336
+
thrownewAthenaConnectorException("Unpacking is only supported for milliseconds", newErrorDetails().withErrorCode(FederationSourceErrorCode.OperationNotSupportedException.toString()));
334
337
}
335
338
// arrowType's timezone is ignored in this case since the timezone is packed into the long
thrownewUnsupportedOperationException("Packing for TimeStampMicroTZ is not currently supported");
407
+
thrownewAthenaConnectorException("Packing for TimeStampMicroTZ is not currently supported", newErrorDetails().withErrorCode(FederationSourceErrorCode.OperationNotSupportedException.toString()));
0 commit comments