Skip to content

Commit

Permalink
fix branch register response (#401)
Browse files Browse the repository at this point in the history
* fix branch register response
  • Loading branch information
luky116 authored Dec 13, 2022
1 parent dcb6ec9 commit 27bd6ac
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion pkg/rm/rm_remoting.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
package rm

import (
"fmt"
"sync"

"github.com/pkg/errors"
Expand Down Expand Up @@ -59,7 +60,11 @@ func (r *RMRemoting) BranchRegister(param BranchRegisterParam) (int64, error) {
log.Errorf("BranchRegister error: %v, res %v", err.Error(), resp)
return 0, err
}
return resp.(message.BranchRegisterResponse).BranchId, nil
branchResp := resp.(message.BranchRegisterResponse)
if branchResp.ResultCode == message.ResultCodeFailed {
return 0, fmt.Errorf("Response %s", branchResp.Msg)
}
return branchResp.BranchId, nil
}

// BranchReport Report status of transaction branch
Expand Down

0 comments on commit 27bd6ac

Please sign in to comment.