Fix: throw the right exception, and look in the right place for an appSetting