Skip to content

fix!: resolve hyper error and bubble rejected non-handled exceptions. #12 #14

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

Merged
merged 6 commits into from
Mar 2, 2022

Conversation

TillaTheHun0
Copy link
Member

@TillaTheHun0 TillaTheHun0 commented Mar 1, 2022

Closes #12
Closes #9

I'm really sorry for the large PR. Most of the diff is utils and tests and lock files. I added a bunch of tests to ensure mappings from ES errors to hyper errors were correct. I can sit down on a call and walk through the changes if that helps.

various bug fixes and error mappings:

  • Elasticsearch will automatically create an index, if you attempt to index a document on an index that doesn't exist. It will create an "auto index" and infer fields to index based on document shape. We don't want that, so we check for existing index on indexDoc, updateDoc, bulk before performing the actual operation
  • properly map elasticsearch error types to hyper errors ie (index not found, doc not found, invalid mapping, etc.)
  • Elasticsearch reserves the _id field on index mappings and documents. So we map _id to a __movedUnderscoreId63__ field internally for mappings, documents, and queries, then back to an _id field when retrieving documents.

I've added a task to the gitpod config to automatically spin up opensearch.

BREAKING CHANGE - caught exceptions are resolved, not rejected, as hyper
errors

The only time a method on the adapter should return a rejected promise
is in the case of an unhandled exception.

Aligns with discussion detailed in:
https://github.com/hyper63/journal/blob/master/design-docs/003-errors.md

…12

various bug fixes and error mappings

BREAKING CHANGE - caught exceptions are resolved, not rejected, as hyper
errors

The only time a method on the adapter should return a rejected promise
is in the case of an unhandled exception.

Aligns with discussion detailed in:
https://github.com/hyper63/journal/blob/master/design-docs/003-errors.md
@gitpod-io
Copy link

gitpod-io bot commented Mar 1, 2022

@TillaTheHun0 TillaTheHun0 force-pushed the tillathehun0/return-hyper-esque-12 branch from 89773a6 to f41c09c Compare March 2, 2022 16:41
@TillaTheHun0 TillaTheHun0 requested a review from twilson63 March 2, 2022 16:47
@TillaTheHun0 TillaTheHun0 merged commit 16614ac into main Mar 2, 2022
@TillaTheHun0 TillaTheHun0 deleted the tillathehun0/return-hyper-esque-12 branch March 2, 2022 22:10
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

Successfully merging this pull request may close these issues.

return hyper-esque errors bug: when adding duplicate document id's a 409 does not return
2 participants