On Thursday, 11 December 2014 at 20:40:40 UTC, Suliman wrote:
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
I'm not 100% sure on this, but I suspect you have to declare the
scope(failure) before you call the code that might execute it.
e.g.
scope(failure) writeln("Looks like the dbname is missing");
string dbname = config.getKey("dbname1");