File tree Expand file tree Collapse file tree 1 file changed +10
-10
lines changed
src/Common/Commands.Common Expand file tree Collapse file tree 1 file changed +10
-10
lines changed Original file line number Diff line number Diff line change @@ -35,20 +35,20 @@ protected static string GetErrorMessageWithRequestIdInfo(CloudException cloudExc
35
35
throw new ArgumentNullException ( "cloudException" ) ;
36
36
}
37
37
38
- var sb = new StringBuilder ( cloudException . Message ) ;
38
+ var sb = new StringBuilder ( ) ;
39
39
40
- if ( cloudException . Response != null )
40
+ if ( ! string . IsNullOrEmpty ( cloudException . Message ) )
41
+ {
42
+ sb . Append ( cloudException . Message ) ;
43
+ }
44
+
45
+ if ( cloudException . Response != null &&
46
+ cloudException . Response . Headers != null )
41
47
{
42
48
var headers = cloudException . Response . Headers ;
43
- if ( headers != null && headers . ContainsKey ( RequestIdHeaderInResponse ) )
49
+ if ( headers . ContainsKey ( RequestIdHeaderInResponse ) )
44
50
{
45
- if ( sb . Length > 0 )
46
- {
47
- // If the original exception message is not empty, append a new line here.
48
- sb . Append ( Environment . NewLine ) ;
49
- }
50
-
51
- sb . AppendFormat (
51
+ sb . AppendLine ( ) . AppendFormat (
52
52
Properties . Resources . ComputeCloudExceptionOperationIdMessage ,
53
53
headers [ RequestIdHeaderInResponse ] . FirstOrDefault ( ) ) ;
54
54
}
You can’t perform that action at this time.
0 commit comments