Skip to content

Commit

Permalink
comments: update MsgTestController with dtm server compatibility note (
Browse files Browse the repository at this point in the history
…#83)

- Add comment explaining compatibility changes in dtm server v1.10
- Highlight changes in HTTP status code handling- Reference specific code in dtm/client/dtmcli/utils.go for implementation details
  • Loading branch information
wooln authored Dec 7, 2024
1 parent d6436bf commit 9f90cc1
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions samples/DtmSample/Controllers/MsgTestController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,22 @@ public async Task<IActionResult> MsgMySqlQueryPrepared(CancellationToken cancell

/// <summary>
/// MSG QueryPrepared(mssql)
///
/// tips: Starting with server v1.10, dtm server changed to use the http status code, but was compatible with the body returned by older versions
/// The http status code 200 with unrecognized body It will be as normal!
/// eg: v1.18.0 [dtm/client/dtmcli/utils.go · dtm-labs/dtm](https://github.com/dtm-labs/dtm/blob/v1.18.0/client/dtmcli/utils.go)
/// func HTTPResp2DtmError(resp *resty.Response) error {
/// code := resp.StatusCode()
/// str := resp.String()
/// if code == http.StatusTooEarly || strings.Contains(str, ResultOngoing) {
/// return ErrorMessage2Error(str, ErrOngoing)
/// } else if code == http.StatusConflict || strings.Contains(str, ResultFailure) {
/// return ErrorMessage2Error(str, ErrFailure)
/// } else if code != http.StatusOK {
/// return errors.New(str)
/// }
/// return nil
/// }
/// </summary>
/// <param name="cancellationToken"></param>
/// <returns></returns>
Expand Down

0 comments on commit 9f90cc1

Please sign in to comment.