Skip to content

Commit

Permalink
Improve error message for "cannot write to property"
Browse files Browse the repository at this point in the history
  • Loading branch information
bandreghetti committed Sep 8, 2020
1 parent 8f08ec7 commit 2ee72df
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion assets/checkWriters.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ func (a Asset) CheckWriters(stub shim.ChaincodeStubInterface) error {
}
}
if !writePermission {
return errors.NewCCError(fmt.Sprintf("%s cannot write to this asset property", txCreator), 403)
return errors.NewCCError(fmt.Sprintf("%s cannot write to the '%s' (%s) asset property", txCreator, prop.Tag, prop.Label), 403)
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion assets/update.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ func (a *Asset) Update(stub shim.ChaincodeStubInterface, update map[string]inter
}
}
if !writePermission {
return nil, errors.NewCCError(fmt.Sprintf("%s cannot write to this asset property", txCreator), 403)
return nil, errors.NewCCError(fmt.Sprintf("%s cannot write to the '%s' (%s) asset property", txCreator, prop.Tag, prop.Label), 403)
}
}

Expand Down

0 comments on commit 2ee72df

Please sign in to comment.