use python exception pattern for config detection