When I run method that throws or runs out of gas I get nothing in error variable in callback. Method acts like everything's ok, but no changes are made.
For example I call:
Test.methodThatThrows({gas: 4752390,from: web3.eth.coinbase}, function(err, res) {console.log(err, res)});
I get output like
null 0x6d5a561224940daa70d6d56c60909255b86af7b9e93a0d8a4f98cacddf0d722b
This is very confusing, especially when you silently run out of has and don't know what's wrong.
I don't know if it's some compiler or geth option or something, couldn't find out.
I'm using
geth 1.4.12-stable-421df866
solc Version: 0.4.1+commit.4fc6fc2.Darwin.appleclang or
0.4.3-develop.2016.9.22+commit.c06ba011.Darwin.appleclang
EDIT: Note, using testrpc would give you back error in such case. With normal network you need to use practices described in the answer.
testrpc, which gives you error back, so I kinda expected the same from normal net – ma2s Sep 23 '16 at 07:36