[OSM-dev] Relations error with JOSM/API
Tom Hughes
tom at compton.nu
Sun Oct 28 17:08:12 GMT 2007
In message <20071028162944.GC30308 at lochewe.mathy.remote.org>
Frederik Ramm <frederik at remote.org> wrote:
> There is a unique key on the relationship member table that prohibits
> inserting the same element twice into the same relationship (unless it
> has different roles, that is).
>
> I guess that raises an exception upon trying to store the object, the
> exception is not caught, and this results in an error 500. We should
> perhaps catch the exception and then return some other, more
> meaningful, error. I'll fix it because I'm responsible for the sloppy
> implementation but what would be a suitable return code?
We usually aim to validate that kind of stuff in ruby rather than
catching the exception (it's probably quite hard to do that as it
will be a fairly general MySQL exception I expect).
As far as a response goes, :bad_qequest is probably right.
Tom
--
Tom Hughes (tom at compton.nu)
http://www.compton.nu/
More information about the dev
mailing list