Skip to content

Commit

Permalink
[FAB-3341] Move errors package to fabric/common
Browse files Browse the repository at this point in the history
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 <wtlahti@us.ibm.com>
  • Loading branch information
wlahti committed Apr 22, 2017
1 parent 95d13d2 commit a1feab0
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 6 deletions.
File renamed without changes.
6 changes: 3 additions & 3 deletions core/errors/errors_test.go → common/errors/errors_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ func TestErrorWithCallstackMessage(t *testing.T) {

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

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

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

// check that the error message contains this part of the stack trace, which
// is non-platform specific
if !strings.Contains(e2.Error(), "github.com/hyperledger/fabric/core/errors.TestErrorWithCallstackMessage_wrapped") {
if !strings.Contains(e2.Error(), "github.com/hyperledger/fabric/common/errors.TestErrorWithCallstackMessage_wrapped") {
t.Fatalf("Error message does not have stack trace appended.")
}
}
Expand Down
2 changes: 1 addition & 1 deletion peer/clilogging/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ limitations under the License.
package clilogging

import (
"github.com/hyperledger/fabric/core/errors"
"github.com/hyperledger/fabric/common/errors"
"github.com/hyperledger/fabric/peer/common"

"github.com/spf13/cobra"
Expand Down
2 changes: 1 addition & 1 deletion peer/common/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ import (
"path/filepath"

"github.com/hyperledger/fabric/bccsp/factory"
"github.com/hyperledger/fabric/common/errors"
"github.com/hyperledger/fabric/common/flogging"
"github.com/hyperledger/fabric/common/viperutil"
"github.com/hyperledger/fabric/core/errors"
"github.com/hyperledger/fabric/core/peer"
"github.com/hyperledger/fabric/msp"
mspmgmt "github.com/hyperledger/fabric/msp/mgmt"
Expand Down
2 changes: 1 addition & 1 deletion peer/core.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ logging:
msp: warning

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

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

0 comments on commit a1feab0

Please sign in to comment.