Closed loneil closed 6 months ago
In the POST allow/publish-did/{DID} endpoint if a duplicate DID allowance is attempted a 500 error in the following form returns
POST allow/publish-did/{DID}
{ "detail": "(sqlalchemy.dialects.postgresql.asyncpg.IntegrityError) <class 'asyncpg.exceptions.UniqueViolationError'>: duplicate key value violates unique constraint \"allowedpublicdid_pkey\"\nDETAIL: Key (registered_did)=(123) already exists.\n[SQL: INSERT INTO allowedpublicdid (registered_did) VALUES (%s) RETURNING allowedpublicdid.created_at, allowedpublicdid.updated_at]\n[parameters: ('123',)]\n(Background on this error at: https://sqlalche.me/e/14/gkpj)" }
Would handle this with a cleaner 4xx level error I think.
Does 409 make more sense in this case?
Yeah either 409 conflict, or 422 invalid data would make sense to me.
In the
POST allow/publish-did/{DID}
endpoint if a duplicate DID allowance is attempted a 500 error in the following form returnsWould handle this with a cleaner 4xx level error I think.