When testing with truffle and testrpc, I'm struggling to test how things should work when a function is called and it causes a throw as the entire test stops. However, several of the functions I have that return throws could also just do nothing. Is this the better structure? Basically, which is better:
function doSomethingThrow(a1) {
if (a1.a == 1){
...
} else if (a1.b == 2) {
...
} else {
throw;
}
or
function doSomethingDontThrow(a1) {
if (a1.a == 1){
...
} else if (a1.b == 2) {
...
}