factory.py: change message level from warning to error in critical sections