Skip to content

Commit

Permalink
Merge pull request #79 from s7techlab/orderer-err-verbose
Browse files Browse the repository at this point in the history
Orderer err verbose
  • Loading branch information
bogatyr285 committed Dec 16, 2021
2 parents d10bb70 + be931f1 commit 10d7f67
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions orderer/orderer.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,12 @@ import (
)

type ErrUnexpectedStatus struct {
status common.Status
status common.Status
message string
}

func (e *ErrUnexpectedStatus) Error() string {
return fmt.Sprintf("unexpected status: %s", e.status.String())
return fmt.Sprintf("unexpected status: %s. message: %v", e.status.String(), e.message)
}

type orderer struct {
Expand Down Expand Up @@ -62,7 +63,10 @@ func (o *orderer) Broadcast(ctx context.Context, envelope *common.Envelope) (res
return
} else {
if resp.Status != common.Status_SUCCESS {
err = &ErrUnexpectedStatus{status: resp.Status}
err = &ErrUnexpectedStatus{
status: resp.Status,
message: resp.Info,
}
return
}
}
Expand Down

0 comments on commit 10d7f67

Please sign in to comment.