failure to add to a repository

Caleb Cushing <[email protected]>
Newsgroups gmane.comp.programming.domain-driven-design
Message-ID <CAAHKNRF1C_Hxu4t-btoOyH8oYgStFBapdSOc-1CqCKnNs8-KHg@mail.gmail.com>
I'm designing a RESTful web service...

My problem is that in thinking a repository has a collection
interface. Given that an add operation on a collection usually either
returns t/f, void, or the object (depending on language). But both
database access and http have further ways of describing the failure
than a simple succeed/fail.

This could be handled in one of 2 ways, custom exceptions or status
codes, I'm writing to see what is generally preferred?

--
Caleb Cushing

http://xenoterracide.com


------------------------------------
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.