# HG changeset patch # User Philippe Pepiot # Date 1466087132 -7200 # Node ID b6f6737d4823d8aa55b1d01b5a83cb0815ac0bf3 # Parent 308ac9def79f2db7e64036e27320657af6568340 wsgi: clearer exception when CW_INSTANCE is missing instance_name is mandatory for cwcfg.config_for() Raise with a KeyError: 'CW_INSTANCE' instead of hard to read exception. diff -r 308ac9def79f -r b6f6737d4823 pyramid_cubicweb/__init__.py --- a/pyramid_cubicweb/__init__.py Fri Jun 03 17:58:43 2016 +0200 +++ b/pyramid_cubicweb/__init__.py Thu Jun 16 16:25:32 2016 +0200 @@ -136,7 +136,7 @@ """ if instance_name is None: - instance_name = os.environ.get('CW_INSTANCE') + instance_name = os.environ['CW_INSTANCE'] if debug is None: debug = 'CW_DEBUG' in os.environ