Re: [Vala] How to ignore exceptions?



Or, maybe, something like this:

try {
    code_that_can_generate_exception_but_we_don't_want_to_catch();
};

I don't know if that would break too much the syntax, or would make it difficult to implement...

El 31/10/11 11:49, pancake escribió:
What about adding a code attribute like [IgnoreException] ? that would perform better than trycatching

On 31/10/2011, at 10:06, Xavier Bestel<xavier bestel free fr>  wrote:

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

_______________________________________________
vala-list mailing list
vala-list gnome org
http://mail.gnome.org/mailman/listinfo/vala-list

_______________________________________________
vala-list mailing list
vala-list gnome org
http://mail.gnome.org/mailman/listinfo/vala-list


--
Nos leemos
                         RASTER    (Linux user #228804)
raster rastersoft com              http://www.rastersoft.com





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