scope block do not handle failure, but try-catch does

Suliman via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Thu Dec 11 12:40:39 PST 2014


string dbname = config.getKey("dbname1");
scope(failure) writeln("look like dbname is missing");

I am using dini and trying to throw exception if value can't be 
extract from config. If I am wrap it's in try-сефср block it's 
work or. But in this situation scope block do not execute and I 
see only stack tracing error on console.

Why? What's wrong. By idea if block failure scope should execute


More information about the Digitalmars-d-learn mailing list