Re: [Vala] How to ignore exceptions?



On Sun, 2011-10-30 at 11:04 -0400, Sam Wilson wrote:
Perhaps a better way to do this is like this:

string[] test = new string[3];
for (int i = 0; i < 3; i++)
{
     try
     {
         test[i] = kf.get_string(group, key);
     }
     catch (KeyFile.Error error)
     {
         // Do nothing
     }
}
if (!test[0] && !test[1] && !test[3]) return false;

What do you think?

Won't that interrupt the execution flow, i.e. if the first
g_key_file_get_string() throws an exception, the other ones won't be
executed ?

        Xav




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]