Rejecting msg.value if error conditions apply

crayons610crayons610 Member Posts: 11
If a contract receives a message with value but a contract logic error condition occurs, can the attached eth be rejected or should it be sent back;

if(blah){
// do good stuff
} else {
address(msg.sender).send(msg.value);
}

Also, what happens to the eth if I throw a hard error like;
int err = 1/0;

Comments

Sign In or Register to comment.