Forum OpenACS Q&A: Re: why does db_transaction { ... } on_error { ... } not catch db_1rows...?

a) no

b) if it is erroring out at the db_1row call then calling db_abort_transaction should work

btw the following returns "Caught" with tcl 8.4 under nsd 4 beta...

db_transaction {
    db_1row test "select 1 from users where user_id = -100"
} on_error {
    ns_return 200 text/html "Caught"

ns_return 200 text/html "asfd"
so if nsd 4 (or 3.5) is an option that is probably your best bet. Unless db_transaction {} works find for this simple test but doesn't for a more complex series of statements.