throw error from Factory.get if factory is not defined