Manage errors in EnvironmentsController