Skip to content

Commit a1feab0

Browse files
committed
[FAB-3341] Move errors package to fabric/common
This CR moves the error handling package from fabric/core to fabric/common so that it can be used by the orderer in addition to the peer. Change-Id: Iaba59f107cc504a4a99464b92cdaccbc3e824736 Signed-off-by: Will Lahti <[email protected]>
1 parent 95d13d2 commit a1feab0

File tree

5 files changed

+6
-6
lines changed

5 files changed

+6
-6
lines changed
File renamed without changes.

core/errors/errors_test.go common/errors/errors_test.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ func TestErrorWithCallstackMessage(t *testing.T) {
118118

119119
// check that the error message contains this part of the stack trace, which
120120
// is non-platform specific
121-
if !strings.Contains(e.Error(), "github.com/hyperledger/fabric/core/errors.TestErrorWithCallstackMessage") {
121+
if !strings.Contains(e.Error(), "github.com/hyperledger/fabric/common/errors.TestErrorWithCallstackMessage") {
122122
t.Fatalf("Error message does not have stack trace appended.")
123123
}
124124
}
@@ -136,7 +136,7 @@ func TestErrorWithCallstackMessage_wrapped(t *testing.T) {
136136

137137
// check that the error message contains this part of the stack trace, which
138138
// is non-platform specific
139-
if !strings.Contains(e.Error(), "github.com/hyperledger/fabric/core/errors.TestErrorWithCallstackMessage_wrapped") {
139+
if !strings.Contains(e.Error(), "github.com/hyperledger/fabric/common/errors.TestErrorWithCallstackMessage_wrapped") {
140140
t.Fatalf("Error message does not have stack trace appended.")
141141
}
142142

@@ -148,7 +148,7 @@ func TestErrorWithCallstackMessage_wrapped(t *testing.T) {
148148

149149
// check that the error message contains this part of the stack trace, which
150150
// is non-platform specific
151-
if !strings.Contains(e2.Error(), "github.com/hyperledger/fabric/core/errors.TestErrorWithCallstackMessage_wrapped") {
151+
if !strings.Contains(e2.Error(), "github.com/hyperledger/fabric/common/errors.TestErrorWithCallstackMessage_wrapped") {
152152
t.Fatalf("Error message does not have stack trace appended.")
153153
}
154154
}

peer/clilogging/common.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ limitations under the License.
1717
package clilogging
1818

1919
import (
20-
"github.com/hyperledger/fabric/core/errors"
20+
"github.com/hyperledger/fabric/common/errors"
2121
"github.com/hyperledger/fabric/peer/common"
2222

2323
"github.com/spf13/cobra"

peer/common/common.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@ import (
2222
"path/filepath"
2323

2424
"github.com/hyperledger/fabric/bccsp/factory"
25+
"github.com/hyperledger/fabric/common/errors"
2526
"github.com/hyperledger/fabric/common/flogging"
2627
"github.com/hyperledger/fabric/common/viperutil"
27-
"github.com/hyperledger/fabric/core/errors"
2828
"github.com/hyperledger/fabric/core/peer"
2929
"github.com/hyperledger/fabric/msp"
3030
mspmgmt "github.com/hyperledger/fabric/msp/mgmt"

peer/core.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ logging:
3131
msp: warning
3232

3333
# Error handling framework log level - when set to DEBUG, a callstack will
34-
# be appended to all errors generated using the fabric/core/errors package
34+
# be appended to all errors generated using the fabric/common/errors package
3535
error: debug
3636

3737
format: '%{color}%{time:2006-01-02 15:04:05.000 MST} [%{module}] %{shortfunc} -> %{level:.4s} %{id:03x}%{color:reset} %{message}'

0 commit comments

Comments
 (0)