I think the motivation behind DM not raising an exception on any save
failure by default is a very simple and intuitive one.

DM cannot assume to know exactly when a failing save can really be
considered *exceptional* behavior. Rather than forcing the user to
treat every single save failure as an exception (which simply isn't
true), it decided to inform users in a friendly and more quiet way,
that doesn't involve the overhead of raising an exception either.
There are lots of situations where a failing save just is no
exceptional behavior, and DM leaves this decision up to the only
entities being able to really decide that, us, programmers.

That said, I totally realize that this is a controversial area, and I
totally agree that the docs should contain more info about which exact
error gets raised, in case #raise_on_save_failure has been turned on.

cheers
snusnu

On Sun, Jul 18, 2010 at 18:51, Philip Silva <[email protected]> wrote:
> Nice... Actually the default behaviour (not raising even though .save
> failed) also made me think dm is broken. Anyways: It would be nice to
> mention which class is thrown, i.e. SaveFailureError right? And that it has
> an attribute @resource...
> Regards, Philip
>
> 2010/7/17 Martin Gamsjaeger <[email protected]>
>>
>> Daniel,
>>
>> You are absolutely right, that doesn't make the best impression :/ I
>> added information about #raise_on_save_failure to the doc site.
>>
>> http://datamapper.org/docs/create_and_destroy
>>
>> Thx for the tip! If you know of any other particular areas you'd like
>> to see the docs improved, feel free to mention them here on this list
>> or maybe even fork the documentation repo at
>>
>> http://github.com/datamapper/datamapper.github.com
>>
>> cheers
>> snusnu
>>
>> On Sat, Jul 17, 2010 at 06:09, Daniel Ribeiro <[email protected]> wrote:
>> > It would be nice if this feature was on the main documentation of
>> > datamapper. It is kinda sad that the easiest way to find is through a
>> > post (with very high google rank) called 'DataMapper is inherently
>> > broken' (http://www.drmaciver.com/2010/04/datamapper-is-inherently-
>> > broken/). It is worse that it is on the comments, as some people may
>> > give up on DM before reaching it.
>> >
>> > Regards,
>> > - Daniel Ribeiro
>> >
>> > --
>> > You received this message because you are subscribed to the Google
>> > Groups "DataMapper" group.
>> > To post to this group, send email to [email protected].
>> > To unsubscribe from this group, send email to
>> > [email protected].
>> > For more options, visit this group at
>> > http://groups.google.com/group/datamapper?hl=en.
>> >
>> >
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "DataMapper" group.
>> To post to this group, send email to [email protected].
>> To unsubscribe from this group, send email to
>> [email protected].
>> For more options, visit this group at
>> http://groups.google.com/group/datamapper?hl=en.
>>
>
> --
> You received this message because you are subscribed to the Google Groups
> "DataMapper" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected].
> For more options, visit this group at
> http://groups.google.com/group/datamapper?hl=en.
>

-- 
You received this message because you are subscribed to the Google Groups 
"DataMapper" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/datamapper?hl=en.

Reply via email to