modio/modio-sdk-legacy

Error response improvement when submitting an existing nameid

Turupawn opened this issue ยท 4 comments

When creating a mod using the Add Mod endpoint. If the optional param nameid is sent with an already existing value in mod.io, the server returns:

{"error":{"code":500,"message":"We experienced a server error attempting to complete your request. The issue has been logged and will be investigated, please try again later."}}

I think would be better if it returns 422 Unprocessable Entity with a message that explains that the mod could not be created because the nameid should be unique.

Good catch, it should check and return the nameid has been taken. Also I believe nameid's are unique to each game. So there can be duplicates as long as they are for different games.

This feature is implemented that it checks and returns that the name has been taken, will investigate why it's not working.

This has been fixed and will be merged in with master in the next day or so, thanks for the report :)

Great!