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

cannotModifyImmutableAttributeError should give me document id #71

Open
hallvors opened this issue Mar 19, 2020 · 2 comments
Open

cannotModifyImmutableAttributeError should give me document id #71

hallvors opened this issue Mar 19, 2020 · 2 comments

Comments

@hallvors
Copy link

hallvors commented Mar 19, 2020

Is your feature request related to a problem? Please describe.

Using the JavaScript client, I create a transaction and push a lot of documents with createOrReplace(). Sometimes I get a Cannot modify immutable attribute "type" error from .commit(), and while I understand why it happens, the error does not have enough detail to tell me which of the many documents is causing the problem. Could this error object be extended a bit to add a documentId property or similar?

Describe the solution you'd like

    "error": {
      "attribute": "_type",
      "description": "Cannot modify immutable attribute \"_type\"",
      "type": "cannotModifyImmutableAttributeError",
      "documentId": "fooo_id"
    }
@vicmeow
Copy link
Contributor

vicmeow commented Apr 6, 2020

Improved error messaging is definitely on our list of todos, so thank you for reporting!

@rexxars rexxars transferred this issue from sanity-io/sanity Dec 14, 2022
@dutsik
Copy link

dutsik commented Jun 7, 2023

But why we should ever receive the issue if we are going to recreate the document from scratch?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants