Skip to content

Commit 3c2d8de

Browse files
authored
Update Utils.cs
- Use const instead of static readonly field - Use `ToString()` to avoid boxing
1 parent 86808ba commit 3c2d8de

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

src/Dtmcli/DtmImp/Utils.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ namespace Dtmcli.DtmImp
88
{
99
public static class Utils
1010
{
11-
private static readonly int StatusTooEarly = 425;
12-
private static readonly string CheckStatusMsgFormat = "http response status: {status}, Message :{dtmResult}";
11+
private const int StatusTooEarly = 425;
12+
private const string CheckStatusMsgFormat = "http response status: {status}, Message :{dtmResult}";
1313

1414
public static async Task<Exception> RespAsErrorCompatible(HttpResponseMessage resp)
1515
{
@@ -36,7 +36,7 @@ public static void CheckStatus(HttpStatusCode status, string dtmResult)
3636
{
3737
if (status != HttpStatusCode.OK || dtmResult.Contains(DtmCommon.Constant.ResultFailure))
3838
{
39-
throw new DtmException(string.Format(CheckStatusMsgFormat, status, dtmResult));
39+
throw new DtmException(string.Format(CheckStatusMsgFormat, status.ToString(), dtmResult));
4040
}
4141
}
4242
}

0 commit comments

Comments
 (0)