Hide Forgot
Posting a domain name that already exists returns 409, but the "messages" array is not the same structure as other messages and so the site handling fails. Should be consistent. Needs to be fixed for sprint exit. Started POST "/broker/rest/domains.json" for 127.0.0.1 at Mon Feb 27 11:32:12 -0500 2012 Processing by DomainsController#create as JSON Parameters: {"namespace"=>"aoeu"} Creating domain with namespace aoeu MongoDataStore.find(CloudUser, test, test) {\"status\":\"conflict\",\"messages\":[\"A namespace with name 'aoeu' already exists\"],\"version\":\"1.0\",\"data\":null,\"type\":null}"
I have a fix for this. Testing it and going to commit it soon.
committed - issue was we have two code paths for validation errors and exceptions when saving out the namespace. During namespace saving we now correctly use the Message object to set the error instead of just setting the error message. I will write unit tests tomorrow and integrate this into the sauce tests I have been working on.
verified on devenv_1648, issue has been fixed. Output: <?xml version="1.0" encoding="UTF-8"?> <response> <version>1.0</version> <type nil="true"></type> <messages> <message> <field>namespace</field> <exit-code>103</exit-code> <severity>error</severity> <text>A namespace with name 'bmengdev5' already exists</text> </message> </messages> <status>conflict</status> <data nil="true"></data> </response>
I also made changes to domain_controller.rb. Now it returns - 409 if the user already has a domain. Only one domain per user is allowed today. - 422 if the namespace is already in use.