Skip to content

Commit

Permalink
GrpcOperationExceptionis replaced by SKException
Browse files Browse the repository at this point in the history
  • Loading branch information
SergeyMenshykh committed Jul 18, 2023
1 parent fb629ef commit ce520b4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 39 deletions.
8 changes: 4 additions & 4 deletions dotnet/src/Skills/Skills.Grpc/GrpcOperationRunner.cs
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ private string GetAddress(GrpcOperation operation, IDictionary<string, string> a

if (string.IsNullOrEmpty(address))
{
throw new GrpcOperationException($"No address provided for the '{operation.Name}' gRPC operation.");
throw new SKException($"No address provided for the '{operation.Name}' gRPC operation.");
}

return address!;
Expand Down Expand Up @@ -155,14 +155,14 @@ private object GenerateOperationRequest(GrpcOperation operation, Type type, IDic
//Getting 'payload' argument to by used as gRPC request message
if (!arguments.TryGetValue(GrpcOperation.PayloadArgumentName, out var payload))
{
throw new GrpcOperationException($"No '{GrpcOperation.PayloadArgumentName}' argument representing gRPC request message is found for the '{operation.Name}' gRPC operation.");
throw new SKException($"No '{GrpcOperation.PayloadArgumentName}' argument representing gRPC request message is found for the '{operation.Name}' gRPC operation.");
}

//Deserializing JSON payload to gRPC request message
var instance = JsonSerializer.Deserialize(payload, type, new JsonSerializerOptions { PropertyNameCaseInsensitive = true });
if (instance == null)
{
throw new GrpcOperationException($"Impossible to create gRPC request message for the '{operation.Name}' gRPC operation.");
throw new SKException($"Impossible to create gRPC request message for the '{operation.Name}' gRPC operation.");
}

return instance;
Expand Down Expand Up @@ -226,7 +226,7 @@ private static TypeInfo BuildGrpcOperationDataContractType(GrpcOperationDataCont
var type = typeBuilder.CreateTypeInfo();
if (type == null)
{
throw new GrpcOperationException($"Impossible to create type for '{dataContractMetadata.Name}' data contract.");
throw new SKException($"Impossible to create type for '{dataContractMetadata.Name}' data contract.");
}

return type;
Expand Down
35 changes: 0 additions & 35 deletions dotnet/src/Skills/Skills.Grpc/Model/GrpcOperationException.cs

This file was deleted.

0 comments on commit ce520b4

Please sign in to comment.