Bubble up error codes to devs (bug 846818)

This also cleans up the use of _error()