remove some redundant code; improve message forwarded from DB errors
remove some redundant code; improve message forwarded from DB errors

jmcarp/sandman,jeffknupp/sandman,aprilcs/sandman,webwlsong/sandman,jmcarp/sandman,beni55/sandman,aprilcs/sandman,jeffknupp/sandman,aprilcs/sandman,webwlsong/sandman,jmcarp/sandman,beni55/sandman,webwlsong/sandman,jeffknupp/sandman,beni55/sandman