diff --git a/Common/src/Exceptions/SubmissionClosed.cs b/Common/src/Exceptions/SubmissionClosedException.cs similarity index 78% rename from Common/src/Exceptions/SubmissionClosed.cs rename to Common/src/Exceptions/SubmissionClosedException.cs index 21d38c0fa..2894f5e9c 100644 --- a/Common/src/Exceptions/SubmissionClosed.cs +++ b/Common/src/Exceptions/SubmissionClosedException.cs @@ -20,19 +20,19 @@ namespace ArmoniK.Core.Common.Exceptions; [Serializable] -public class SubmissionClosed : ArmoniKException +public class SubmissionClosedException : ArmoniKException { - public SubmissionClosed() + public SubmissionClosedException() { } - public SubmissionClosed(string message) + public SubmissionClosedException(string message) : base(message) { } - public SubmissionClosed(string message, - Exception innerException) + public SubmissionClosedException(string message, + Exception innerException) : base(message, innerException) { diff --git a/Common/src/Storage/TaskLifeCycleHelper.cs b/Common/src/Storage/TaskLifeCycleHelper.cs index a9542120e..a0d629e2b 100644 --- a/Common/src/Storage/TaskLifeCycleHelper.cs +++ b/Common/src/Storage/TaskLifeCycleHelper.cs @@ -89,13 +89,13 @@ public static TaskOptions ValidateSession(SessionData sessionData, // we are on client side if (sessionData.SessionId == parentTaskId && !sessionData.ClientSubmission) { - throw new SubmissionClosed("Client submission is closed"); + throw new SubmissionClosedException("Client submission is closed"); } // we are on worker side if (sessionData.SessionId != parentTaskId && !sessionData.WorkerSubmission) { - throw new SubmissionClosed("Worker submission is closed"); + throw new SubmissionClosedException("Worker submission is closed"); } return localOptions; diff --git a/Common/src/gRPC/Services/GrpcTasksService.cs b/Common/src/gRPC/Services/GrpcTasksService.cs index b6bf5a3c9..381d8b8fa 100644 --- a/Common/src/gRPC/Services/GrpcTasksService.cs +++ b/Common/src/gRPC/Services/GrpcTasksService.cs @@ -463,7 +463,7 @@ await TaskLifeCycleHelper.FinalizeTaskCreation(taskTable_, }, }; } - catch (SubmissionClosed e) + catch (SubmissionClosedException e) { logger_.LogWarning(e, "Error while submitting tasks"); diff --git a/Common/tests/Pollster/AgentTest.cs b/Common/tests/Pollster/AgentTest.cs index 91b19f997..d42cb06ea 100644 --- a/Common/tests/Pollster/AgentTest.cs +++ b/Common/tests/Pollster/AgentTest.cs @@ -706,17 +706,17 @@ await holder.SessionTable.StopSubmissionAsync(holder.Session, holder.Token, NullLogger.Instance); - Assert.ThrowsAsync(() => agent.SubmitTasks(new TaskSubmissionRequest[] - { - new("payload", - null, - new List(), - new List()), - }, - null, - holder.Session, - holder.Token, - CancellationToken.None)); + Assert.ThrowsAsync(() => agent.SubmitTasks(new TaskSubmissionRequest[] + { + new("payload", + null, + new List(), + new List()), + }, + null, + holder.Session, + holder.Token, + CancellationToken.None)); } [Test]