diff --git a/lang/csharp/src/apache/ipc/Responder.cs b/lang/csharp/src/apache/ipc/Responder.cs index 875977462d5..10c40670a05 100644 --- a/lang/csharp/src/apache/ipc/Responder.cs +++ b/lang/csharp/src/apache/ipc/Responder.cs @@ -181,14 +181,14 @@ public IList Respond(IList buffers, WriteResponse(m.Response, response, output); else { - try - { - WriteError(m.SupportedErrors, error, output); - } - catch (Exception) - { - // Presumably no match on the exception, throw the original - throw error; + try + { + WriteError(m.SupportedErrors, error, output); + } + catch (Exception) + { + // Presumably no match on the exception, throw the original + throw error; } } } diff --git a/lang/csharp/src/apache/ipc/Specific/SpecificRequestor.cs b/lang/csharp/src/apache/ipc/Specific/SpecificRequestor.cs index b14ceff4fed..4ef8916d9b5 100644 --- a/lang/csharp/src/apache/ipc/Specific/SpecificRequestor.cs +++ b/lang/csharp/src/apache/ipc/Specific/SpecificRequestor.cs @@ -1,4 +1,4 @@ -/** +/** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information @@ -87,8 +87,8 @@ public override object ReadResponse(Schema writer, Schema reader, Decoder decode public override Exception ReadError(Schema writer, Schema reader, Decoder decoder) { - var response = new SpecificReader(writer, reader).Read(null, decoder); - + var response = new SpecificReader(writer, reader).Read(null, decoder); + var error = response as Exception; if(error != null) return error;