Skip to content

Conversation

@TillaTheHun0
Copy link
Member

@TillaTheHun0 TillaTheHun0 commented Mar 2, 2022

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 2, 2022

@TillaTheHun0 TillaTheHun0 merged commit b1b8a41 into main Mar 2, 2022
@TillaTheHun0 TillaTheHun0 deleted the tillathehun0/return-hyper-esque-12 branch March 2, 2022 22:23
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.

2 participants