[Date Prev][Date Next] [Thread Prev][Thread Next]
[Thread Index]
[Date Index]
[Author Index]
Re: [Vala] Can I use the symbolic name of the code of errors in code
- From: "Jaap A. Haitsma" <jaap haitsma org>
- To: "Jürg Billeter" <j bitron ch>
- Cc: vala-list gnome org
- Subject: Re: [Vala] Can I use the symbolic name of the code of errors in code
- Date: Wed, 30 Apr 2008 10:48:55 +0200
On Wed, Apr 30, 2008 at 10:31 AM, Jürg Billeter <j bitron ch> wrote:
> On Tue, 2008-04-29 at 18:08 +0200, Jaap A. Haitsma wrote:
> > Say I have the program at the bottom of this mail and in the catch
> > clause I want to know the error that was thrown was from the FAILED or
> > the SYNTAX code. How can I check this. I can obtain the error code by
> > e.code but how do I compare it with FAILED or SYNTAX
> >
> > I'd like to write something like:
> >
> > if (e.code == MyError.FAILED) {
> >
> > }
>
> I was planning to add support for
>
> if (e is MyError.FAILED)
>
> and also
>
> catch (MyError.FAILED e)
>
> i.e. treat error codes as subtypes of error domains.
>
> Any comments or objections?
>
Go for it!!
Jaap
[Date Prev][Date Next] [Thread Prev][Thread Next]
[Thread Index]
[Date Index]
[Author Index]