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

suggest: helpful error messages on failed batched operations #35

Open
not-ivy opened this issue Aug 12, 2023 · 3 comments
Open

suggest: helpful error messages on failed batched operations #35

not-ivy opened this issue Aug 12, 2023 · 3 comments

Comments

@not-ivy
Copy link

not-ivy commented Aug 12, 2023

Currently, I am having an issue with creating entries in my db, and it only fails with this stacktrace:

error: Uncaught Error: Could not perform batched create operation.
      throw new PentagonBatchOpError(
            ^
    at withBatchedOperation (https://deno.land/x/pentagon@v0.1.4/src/batchOperations.ts:36:13)
    at eventLoopTick (ext:core/01_core.js:183:11)
    at async createMany (https://deno.land/x/pentagon@v0.1.4/src/crud.ts:135:41)
    at async create (https://deno.land/x/pentagon@v0.1.4/src/crud.ts:124:11)
    at async createImpl (https://deno.land/x/pentagon@v0.1.4/src/pentagon.ts:62:10)

it would be more helpful to provide more details on why the operation was failed when invoking res.commit().

@not-ivy
Copy link
Author

not-ivy commented Aug 12, 2023

here is the playground to reproduce this error:
https://dash.deno.com/playground/pentagon-reproduce-35

@skoshx
Copy link
Owner

skoshx commented Aug 15, 2023

Hello, I understand your frustration with the errors being quite "cryptic". One of the contributing factors to this is that Deno KV doesn't return anything other than ok: false when an error occurs, so creating more helpful error messages is somewhat tricky.

We will keep this open for now, and at some time implement helper functions that tries to find which versionstamps / schemas are cuasing the operations to fail.

Btw, I can't access the playground for some reason, it just redirects me to the login page, or to my projects page... Is the playground marked as public?

@not-ivy
Copy link
Author

not-ivy commented Oct 11, 2023

sorry, it was marked as private. it should be open now

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

2 participants