|
|
Choosing A Webhost: |
Re: first cut of hal service description file: msg#00201freedesktop.dbus
On Fri, 2005-04-01 at 00:23 +0200, Tako Schotanus wrote: > Regardless of the fact if the exception is explicitly defined or not it > is important to be able to figure out which exception has been thrown so > that the caller can decide to handle it or to throw it up the chain. In > what way will that be made possible? Because just one generic > DBusException seems pretty useless. Or it will force you to write > old-style code where return-values tell you if the method-call did its > job or not (eg. did DeleteFile actually delete the file) and the > exception will only tell you that something worse happened (eg. the bus > went off-line, connection failure). Just have subclasses, right? So the method signature is: Foo() throws SuperClass; But you have: class SubClass1 extends SuperClass; class SubClass2 extends SuperClass; Then you can catch(SubClass1) if you want... isn't this allowed in most languages? It doesn't really work though, since there's no "IDL" to contain SubClass1 - so I think in practice the answer is: class DBusException { boolean hasName(String name); } and the code is: catch (DBusException e) { if (e.hasName("org.freedesktop.Foo")) // handle else throw e; } Kind of ugly, but it's the price of staying dynamic rather than static. Havoc
|
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | Re: Where to start, Havoc Pennington |
|---|---|
| Previous by Thread: | Re: first cut of hal service description file, Tako Schotanus |
| Next by Thread: | Re: first cut of hal service description file, David Zeuthen |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
Free MagazinesCisco NewsReceive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business. subscribe Systems Management News, the newspaper for IT systems administration and data center managers! Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field. subscribe The Enterprise Newsweekly eWeek is the essential technology information source for builders of e-business. subscribe Oracle Magazine Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company. subscribe Total Telecom Total Telecom is "The Economist of the communications industry". subscribe |
Home
| advertise | OSDir is
an inevitable website.
|