This is an automated email from the ASF dual-hosted git repository.

dinglei pushed a commit to branch native
in repository https://gitbox.apache.org/repos/asf/rocketmq-client-go.git


The following commit(s) were added to refs/heads/native by this push:
     new adc707f  feat: support mq error (#392)
adc707f is described below

commit adc707f730e136a1969d4f0ab7adffcb173ebd9f
Author: xujianhai666 <[email protected]>
AuthorDate: Thu Feb 13 17:52:51 2020 +0800

    feat: support mq error (#392)
    
    close #391
---
 primitive/errors.go | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/primitive/errors.go b/primitive/errors.go
index af18999..5a53a9f 100644
--- a/primitive/errors.go
+++ b/primitive/errors.go
@@ -19,6 +19,7 @@ package primitive
 
 import (
        "errors"
+       "strconv"
 )
 
 var (
@@ -26,3 +27,12 @@ var (
        ErrMultiIP      = errors.New("multiple IP addr does not support")
        ErrIllegalIP    = errors.New("IP addr error")
 )
+
+type MQBrokerErr struct {
+       ResponseCode int16
+       ErrorMessage string
+}
+
+func (e MQBrokerErr) Error() string {
+       return "CODE: " + strconv.Itoa(int(e.ResponseCode)) + "  DESC: " + 
e.ErrorMessage
+}

Reply via email to