Re: [Vala] Can I use the symbolic name of the code of errors in code
- From: Jürg Billeter <j bitron ch>
- To: "Jaap A. Haitsma" <jaap haitsma org>
- 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:31:15 +0200
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?
Juerg
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]