Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ public void testTaskNotFoundErrorUnmarshalling() {
public void testUnsupportedOperationErrorUnmarshalling() {
String errorMessage = "Operation not supported";
StatusRuntimeException grpcException = createA2AStatusException(
Status.Code.UNIMPLEMENTED.value(), errorMessage, "UNSUPPORTED_OPERATION");
Status.Code.FAILED_PRECONDITION.value(), errorMessage, "UNSUPPORTED_OPERATION");

A2AClientException result = GrpcErrorMapper.mapGrpcError(grpcException);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public enum A2AErrorCodes {
PUSH_NOTIFICATION_NOT_SUPPORTED(-32003, "UNIMPLEMENTED", 400),

/** Error code indicating the requested operation is not supported (-32004). */
UNSUPPORTED_OPERATION(-32004, "UNIMPLEMENTED", 400),
UNSUPPORTED_OPERATION(-32004, "FAILED_PRECONDITION", 400),

/** Error code indicating the content type is not supported (-32005). */
CONTENT_TYPE_NOT_SUPPORTED(-32005, "INVALID_ARGUMENT", 415),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@
* <li>{@link org.a2aproject.sdk.spec.MethodNotFoundError} → {@link Status#NOT_FOUND}</li>
* <li>{@link org.a2aproject.sdk.spec.TaskNotFoundError} → {@link Status#NOT_FOUND}</li>
* <li>{@link org.a2aproject.sdk.spec.InternalError} → {@link Status#INTERNAL}</li>
* <li>{@link org.a2aproject.sdk.spec.UnsupportedOperationError} → {@link Status#UNIMPLEMENTED}</li>
* <li>{@link org.a2aproject.sdk.spec.UnsupportedOperationError} → {@link Status#FAILED_PRECONDITION}</li>
* <li>{@link SecurityException} → {@link Status#UNAUTHENTICATED} or {@link Status#PERMISSION_DENIED}</li>
* </ul>
*
Expand Down Expand Up @@ -746,7 +746,7 @@ private void installForkedContextWrapper(ServerCallContext context) {
* <li>{@link TaskNotFoundError} → {@code NOT_FOUND}</li>
* <li>{@link TaskNotCancelableError} → {@code FAILED_PRECONDITION}</li>
* <li>{@link PushNotificationNotSupportedError} → {@code UNIMPLEMENTED}</li>
* <li>{@link UnsupportedOperationError} → {@code UNIMPLEMENTED}</li>
* <li>{@link UnsupportedOperationError} → {@code FAILED_PRECONDITION}</li>
* <li>{@link JSONParseError} → {@code INTERNAL}</li>
* <li>{@link ContentTypeNotSupportedError} → {@code INVALID_ARGUMENT}</li>
* <li>{@link InvalidAgentResponseError} → {@code INTERNAL}</li>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ public void testOnCancelTaskNotSupported() throws Exception {
handler.cancelTask(request, streamRecorder);
streamRecorder.awaitCompletion(5, TimeUnit.SECONDS);

assertGrpcError(streamRecorder, Status.Code.UNIMPLEMENTED);
assertGrpcError(streamRecorder, Status.Code.FAILED_PRECONDITION);
}

@Test
Expand Down Expand Up @@ -218,7 +218,7 @@ public void testOnMessageError() throws Exception {
agentEmitter.fail(new UnsupportedOperationError());
};
StreamRecorder<SendMessageResponse> streamRecorder = sendMessageRequest(handler);
assertGrpcError(streamRecorder, Status.Code.UNIMPLEMENTED);
assertGrpcError(streamRecorder, Status.Code.FAILED_PRECONDITION);
}

@Test
Expand Down Expand Up @@ -286,7 +286,7 @@ public void testOnGetPushNotificationNoPushNotifierConfig() throws Exception {
GrpcHandler handler = new TestGrpcHandler(card, requestHandler, internalExecutor);
StreamRecorder<TaskPushNotificationConfig> streamRecorder = getTaskPushNotificationConfigRequest(handler,
AbstractA2ARequestHandlerTest.MINIMAL_TASK.id(), AbstractA2ARequestHandlerTest.MINIMAL_TASK.id());
assertGrpcError(streamRecorder, Status.Code.UNIMPLEMENTED);
assertGrpcError(streamRecorder, Status.Code.FAILED_PRECONDITION);
}

@Test
Expand All @@ -301,7 +301,7 @@ public void testOnSetPushNotificationNoPushNotifierConfig() throws Exception {
GrpcHandler handler = new TestGrpcHandler(card, requestHandler, internalExecutor);
StreamRecorder<TaskPushNotificationConfig> streamRecorder = createTaskPushNotificationConfigRequest(handler,
AbstractA2ARequestHandlerTest.MINIMAL_TASK.id(), AbstractA2ARequestHandlerTest.MINIMAL_TASK.id());
assertGrpcError(streamRecorder, Status.Code.UNIMPLEMENTED);
assertGrpcError(streamRecorder, Status.Code.FAILED_PRECONDITION);
}

@Test
Expand Down Expand Up @@ -625,7 +625,7 @@ public void testStreamingNotSupportedError() throws Exception {
AgentCard card = AbstractA2ARequestHandlerTest.createAgentCard(false, true);
GrpcHandler handler = new TestGrpcHandler(card, requestHandler, internalExecutor);
StreamRecorder<StreamResponse> streamRecorder = sendStreamingMessageRequest(handler);
assertGrpcError(streamRecorder, Status.Code.UNIMPLEMENTED);
assertGrpcError(streamRecorder, Status.Code.FAILED_PRECONDITION);
}

@Test
Expand All @@ -639,7 +639,7 @@ public void testStreamingNotSupportedErrorOnSubscribeToTask() throws Exception {
StreamRecorder<StreamResponse> streamRecorder = StreamRecorder.create();
handler.subscribeToTask(request, streamRecorder);
streamRecorder.awaitCompletion(5, TimeUnit.SECONDS);
assertGrpcError(streamRecorder, Status.Code.UNIMPLEMENTED);
assertGrpcError(streamRecorder, Status.Code.FAILED_PRECONDITION);
}

@Test
Expand Down Expand Up @@ -735,7 +735,7 @@ public void testListPushNotificationConfigNoPushConfigStore() {
.build();
StreamRecorder<ListTaskPushNotificationConfigsResponse> streamRecorder = StreamRecorder.create();
handler.listTaskPushNotificationConfigs(request, streamRecorder);
assertGrpcError(streamRecorder, Status.Code.UNIMPLEMENTED);
assertGrpcError(streamRecorder, Status.Code.FAILED_PRECONDITION);
}

@Test
Expand Down Expand Up @@ -806,7 +806,7 @@ public void testDeletePushNotificationConfigNoPushConfigStore() {
.build();
StreamRecorder<Empty> streamRecorder = StreamRecorder.create();
handler.deleteTaskPushNotificationConfig(request, streamRecorder);
assertGrpcError(streamRecorder, Status.Code.UNIMPLEMENTED);
assertGrpcError(streamRecorder, Status.Code.FAILED_PRECONDITION);
}

@Disabled
Expand Down
Loading