@@ -184,10 +184,10 @@ public static Exception ToMessagingContractException(string condition, string me
184184 public static Exception TranslateException ( Exception exception , string referenceId = null , Exception innerException = null , bool connectionError = false )
185185 {
186186 var stringBuilder = new StringBuilder ( ) ;
187- stringBuilder . AppendFormat ( CultureInfo . InvariantCulture , exception . Message ) ;
187+ stringBuilder . Append ( exception . Message ) ;
188188 if ( referenceId != null )
189189 {
190- stringBuilder . AppendFormat ( CultureInfo . InvariantCulture , $ "Reference: { referenceId } , { DateTime . UtcNow } ") ;
190+ stringBuilder . Append ( $ "Reference: { referenceId } , { DateTime . UtcNow } ") ;
191191 }
192192
193193 var message = stringBuilder . ToString ( ) ;
@@ -196,13 +196,13 @@ public static Exception TranslateException(Exception exception, string reference
196196 switch ( exception )
197197 {
198198 case SocketException _:
199- message = stringBuilder . AppendFormat ( CultureInfo . InvariantCulture , $ " ErrorCode: { ( ( SocketException ) exception ) . SocketErrorCode } ") . ToString ( ) ;
199+ message = stringBuilder . Append ( $ " ErrorCode: { ( ( SocketException ) exception ) . SocketErrorCode } ") . ToString ( ) ;
200200 return new ServiceBusException ( message , ServiceBusFailureReason . ServiceCommunicationProblem , innerException : aggregateException ) ;
201201
202202 case IOException _:
203203 if ( exception . InnerException is SocketException socketException )
204204 {
205- message = stringBuilder . AppendFormat ( CultureInfo . InvariantCulture , $ " ErrorCode: { socketException . SocketErrorCode } ") . ToString ( ) ;
205+ message = stringBuilder . Append ( $ " ErrorCode: { socketException . SocketErrorCode } ") . ToString ( ) ;
206206 }
207207 return new ServiceBusException ( message , ServiceBusFailureReason . ServiceCommunicationProblem , innerException : aggregateException ) ;
208208
0 commit comments