convert a number of die calls to _error() calls