refactor error handling on users#update in rails controller