Transaction Result?

If I do a transaction block. How do I know if it passed or failed? I dont want to have to keep saying

@saved = true if(something)

then at the end find out if @saved is true