Moving error messages to error object.