Skip to content

Commit

Permalink
[FAB-8481] suppress file system info from error
Browse files Browse the repository at this point in the history
Output internal error as an error log and suppress
it from error returned to user.

Change-Id: I2c9e41a7412276af30cdc531dc6cb74359373b50
Signed-off-by: Srinivasan Muralidharan <srinivasan.muralidharan99@gmail.com>
  • Loading branch information
muralisrini committed Feb 25, 2018
1 parent 804a060 commit 5f5ce53
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion core/scc/lscc/lscc.go
Original file line number Diff line number Diff line change
Expand Up @@ -465,7 +465,9 @@ func (lscc *lifeCycleSysCC) executeDeployOrUpgrade(

ccpack, err := lscc.support.GetChaincodeFromLocalStorage(cds.ChaincodeSpec.ChaincodeId.Name, cds.ChaincodeSpec.ChaincodeId.Version)
if err != nil {
return nil, fmt.Errorf("cannot get package for chaincode (%s:%s)-%s", cds.ChaincodeSpec.ChaincodeId.Name, cds.ChaincodeSpec.ChaincodeId.Version, err)
retErrMsg := fmt.Sprintf("cannot get package for chaincode (%s:%s)", cds.ChaincodeSpec.ChaincodeId.Name, cds.ChaincodeSpec.ChaincodeId.Version)
logger.Errorf("%s-err:%s", retErrMsg, err)
return nil, fmt.Errorf("%s", retErrMsg)
}
cd := ccpack.GetChaincodeData()

Expand Down
2 changes: 1 addition & 1 deletion core/scc/lscc/lscc_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ func TestDeploy(t *testing.T) {

testDeploy(t, "example02", "0", path, false, false, true, "", nil, nil)
testDeploy(t, "example02", "1.0", path, false, false, true, "", nil, nil)
testDeploy(t, "example02", "1.0", path, false, false, false, "cannot get package for chaincode (example02:1.0)-barf", nil, nil)
testDeploy(t, "example02", "1.0", path, false, false, false, "cannot get package for chaincode (example02:1.0)", nil, nil)
testDeploy(t, "example02", "0", path, true, false, true, EmptyChaincodeNameErr("").Error(), nil, nil)
testDeploy(t, "example02", "0", path, false, true, true, EmptyVersionErr("example02").Error(), nil, nil)
testDeploy(t, "example02.go", "0", path, false, false, true, InvalidChaincodeNameErr("example02.go").Error(), nil, nil)
Expand Down

0 comments on commit 5f5ce53

Please sign in to comment.