Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DocumentDB unique error does not have keyValue in Error object, generic error shown #4460

Open
mvdve opened this issue Dec 12, 2023 · 2 comments · Fixed by #4513
Open

DocumentDB unique error does not have keyValue in Error object, generic error shown #4460

mvdve opened this issue Dec 12, 2023 · 2 comments · Fixed by #4513
Assignees
Labels
db: mongodb @payloadcms/db-mongodb prioritized status: needs-triage Possible bug which hasn't been reproduced yet v2

Comments

@mvdve
Copy link

mvdve commented Dec 12, 2023

Link to reproduction

No response

Describe the Bug

The error message for unique field values is not working on Document DB. The keyValue variable is not present within the error object and so the generic error "something went wrong" is shown in production:

When connected to MongoDB:

ok: 0,
code: 11000,
codeName: 'DuplicateKey',
keyPattern: { slug: 1 },
keyValue: { slug: 'test' },
[Symbol(errorLabels)]: Set(0) {}

When connected to DocumentDB:

ok: 0,
operationTime: new Timestamp({ t: 1702377946, i: 1 }),
code: 11000,
[Symbol(errorLabels)]: Set(0) {}

Used here and here

To Reproduce

  • Run PayloadCMS 2.3.1 with DocumentDB
  • Create a unique field
  • Try to add two items with the same field value

Payload Version

2.3.1

Adapters and Plugins

db-mongodb

@mvdve mvdve added the status: needs-triage Possible bug which hasn't been reproduced yet label Dec 12, 2023
@DanRibbens DanRibbens self-assigned this Dec 12, 2023
@jacobsfletch jacobsfletch added the db: mongodb @payloadcms/db-mongodb label Dec 13, 2023
Copy link
Contributor

github-actions bot commented Sep 7, 2024

This issue has been automatically locked.
Please open a new issue if this issue persists with any additional detail.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 7, 2024
@jmikrut jmikrut reopened this Oct 15, 2024
@jmikrut
Copy link
Member

jmikrut commented Oct 15, 2024

This is reported to possibly still be an issue. We should re-check into this on v3.0

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
db: mongodb @payloadcms/db-mongodb prioritized status: needs-triage Possible bug which hasn't been reproduced yet v2
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants