platform icon indicating copy to clipboard operation
platform copied to clipboard

fix:Incorrect error message displayed for duplicate DID creation in organization wallet

Open sayali-chavan2396 opened this issue 7 months ago • 3 comments

Description: When attempting to create a duplicate DID in the organization wallet, an incorrect error message is displayed. Instead of providing a clear and meaningful error message indicating that the DID already exists, the system returns a generic message: "Something went wrong!" along with a 500 status code

Method

POST/v1/orgs/{orgId}/agents/did (Create new DID)

Request { "seed": "IuC96B_UkJa-1Q2K1832zqHs-4RgxTyn", "keyType": "ed25519", "method": "indy", "network": "indicio:demonet", "role": "endorser", "isPrimaryDid": false }

Steps to Reproduce

  1. Attempt to create a DID that already exists in the organization wallet.
  2. Observe the response.

Current behavior { "statusCode": 500, "message": "Something went wrong!", "error": "CredoError: Key already exists" }

Expected behavior

{ "statusCode": 409, "message": "DID already exist", "error": "Conflict" }

Screenshot

Image

sayali-chavan2396 avatar May 08 '25 10:05 sayali-chavan2396

Hey I would like to work on this issue. Can you please assign this to me? Thanks.

pallavi704 avatar May 10 '25 07:05 pallavi704

Hey I would like to work on this issue. Can you please assign this to me? Thanks.

Thanks @pallavi704 for picking this up.

ajile-in avatar May 11 '25 17:05 ajile-in

Hey @ajile-in , thanks. I will submit the PR once I finish the testing in my local.

pallavi704 avatar May 14 '25 17:05 pallavi704