On Apr 25, 2007, at 10:15 AM, Thom McGrath wrote:

> Ok, I'm writing these classes and discovering more and more why I
> love and hate feeds. This is nothing new to me, I've designed similar
> classes in other languages before, but it's been a while.
>
> But regardless, I have a REALbasic design question!
>
> How should I post/handle errors? What I mean is, for example, author/
> person elements require a name element in ATOM, while they require an
> email address in RSS. What should happen if the developer/user tries
> to create an author element in ATOM which does not contain a name?
>
> I've though about subclassing RuntimeException and doing something
> such as
>
> raise new rssexception("Author elements must contain a name in Atom
> feeds")
>
> but this really doesn't work because it doesn't allow the developer
> to catch the error without modifying the class. I could use an error
> event, but I do not intend for these classes to be used that way at
> all, and would be a terrible strain on the developer.
>
> So should I use something like .LastErrorMsg and .LastErrorCode? It
> seems like the best bet, but I find this method annoying to implement
> and use.
>
> Any other ideas, or should I use properties?


In the case you present, you can't really continue, and you don't  
know how the error should be handled.  So I think an exception is the  
proper thing to do.

Charles Yeomans
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives:
<http://support.realsoftware.com/listarchives/lists.html>

Reply via email to