On Monday, 15 December 2014 at 07:41:40 UTC, drug wrote:
On 13.12.2014 23:26, Suliman wrote:
I reread docs and understood that scope not for such case.
Next code is do what I need:
try
{
string dbname = config.getKey(dbname);
string dbpass = config.getKey(dbpass);
string dbhost =
On 15.12.2014 12:22, Marc Schütz schue...@gmx.net wrote:
Unfortunately you don't have access to the exception object inside the
`scope(failure)` block.
Ah, yes, it has to be without msg.msg
scope(failure) writeln(Something is wrong);
On 13.12.2014 23:26, Suliman wrote:
I reread docs and understood that scope not for such case.
Next code is do what I need:
try
{
string dbname = config.getKey(dbname);
string dbpass = config.getKey(dbpass);
string dbhost = config.getKey(dbhost);
string dbport = config.getKey(dbport);
}
catch
If I right understand scope is not good for checking if one of
function is fail.
For example:
string dbpass = config.getKey(dbpass);
string dbpass = config.getKey(dbpass);
string dbhost = config.getKey(dbhost);
string dbport = config.getKey(dbport);
if I will try to add scope(failure)
I reread docs and understood that scope not for such case.
Next code is do what I need:
try
{
string dbname = config.getKey(dbname);
string dbpass = config.getKey(dbpass);
string dbhost = config.getKey(dbhost);
string dbport = config.getKey(dbport);
}
catch
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
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.