Use error() more consistently