better error reporting for db exceptions