mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 17:59:23 -04:00
Part of https://github.com/elastic/kibana/issues/171570 PR breaks EsError out of data plugin and into @kbn/search-errors package. This will allow for future efforts to move [lens error handing](https://github.com/elastic/kibana/blob/main/x-pack/plugins/lens/public/editor_frame_service/error_helper.tsx) into this package and more closely align error handling across kibana. An unplanned part of this PR was moving `BfetchRequestError` into its own package `@kbn/bfetch`. This is required because `@kbn/search-errors` package can not import code from a plugin. `BfetchRequestError` could not be part of `@kbn/search-errors` because that created a circular dependency graph. Another unexpected problem found while working on this PR is that the package had to be included in `ui-shared-deps`. The reason for this is that `renderSearchError` uses `instanceof EsError` check to determine if an error is an EsError. This check failed when the package was not included in `ui-shared-deps` because each plugin got its own copy of `kbn/search-error` plugin. This meant that `data` plugin had its own copy of `EsError` class when the error is generated, then `discover` plugin had its own copy of `EsError` class when the instanceof check occurs. `instanceof` check unexpectedly returned false in this case. Moving plugin to `ui-shared-deps` results in a single instance of the plugin. Thanks @mistic for the help with moving package into `ui-shared-deps` --------- Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com> Co-authored-by: Tiago Costa <tiago.costa@elastic.co> Co-authored-by: Davis McPhee <davismcphee@hotmail.com> |
||
---|---|---|
.. | ||
src | ||
BUILD.bazel | ||
index.ts | ||
jest.config.js | ||
kibana.jsonc | ||
package.json | ||
README.md | ||
tsconfig.json |
@kbn/bfetch-error
package isolating befetch error logic