Return invalid state attribute in appropriate branch

This commit is contained in:
Eric Meyer 2017-12-04 13:30:57 -06:00
parent 71de8e970d
commit 3af336a34a

View File

@ -51,7 +51,7 @@ func (blockchain *GethBlockchain) GetAttribute(contract core.Contract, attribute
}
input, err := parsed.Pack(attributeName)
if err != nil {
return nil, err
return nil, ErrInvalidStateAttribute
}
output, err := callContract(contract, input, err, blockchain, blockNumber)
if err != nil {
@ -59,7 +59,7 @@ func (blockchain *GethBlockchain) GetAttribute(contract core.Contract, attribute
}
err = parsed.Unpack(&result, attributeName, output)
if err != nil {
return nil, ErrInvalidStateAttribute
return nil, err
}
return result, nil
}