-
Notifications
You must be signed in to change notification settings - Fork 8.5k
[onechat] Improve user-facing error messages in toasts #229254
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
[onechat] Improve user-facing error messages in toasts #229254
Conversation
|
/ci |
|
/ci |
pgayvallet
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM once moved to the right package
x-pack/platform/packages/shared/onechat/onechat-common/base/errors.ts
Outdated
Show resolved
Hide resolved
💔 Build Failed
Failed CI StepsTest Failures
Metrics [docs]Module Count
Public APIs missing comments
Any counts in public APIs
Async chunks
History
|
|
@elasticmachine merge upstream |
## Summary - Add onechat-common method to extract actual error msg from the onechat error object - That impl was inspration https://github.com/elastic/kibana/blob/main/src/core/packages/fatal-errors/browser-internal/src/get_error_info.ts#L15 (but it's private + contains some cases we don't care about) - All onechat errors are instances of [ServerSentEventError](https://github.com/elastic/kibana/blob/main/src/platform/packages/shared/kbn-sse-utils/src/errors.ts#L18) and the default `err.message` property is not populated - Update toasts Verified locally that now `Bad Request` text is actually changed with the error body.message --------- Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
## Summary - Add onechat-common method to extract actual error msg from the onechat error object - That impl was inspration https://github.com/elastic/kibana/blob/main/src/core/packages/fatal-errors/browser-internal/src/get_error_info.ts#L15 (but it's private + contains some cases we don't care about) - All onechat errors are instances of [ServerSentEventError](https://github.com/elastic/kibana/blob/main/src/platform/packages/shared/kbn-sse-utils/src/errors.ts#L18) and the default `err.message` property is not populated - Update toasts Verified locally that now `Bad Request` text is actually changed with the error body.message --------- Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
## Summary - Add onechat-common method to extract actual error msg from the onechat error object - That impl was inspration https://github.com/elastic/kibana/blob/main/src/core/packages/fatal-errors/browser-internal/src/get_error_info.ts#L15 (but it's private + contains some cases we don't care about) - All onechat errors are instances of [ServerSentEventError](https://github.com/elastic/kibana/blob/main/src/platform/packages/shared/kbn-sse-utils/src/errors.ts#L18) and the default `err.message` property is not populated - Update toasts Verified locally that now `Bad Request` text is actually changed with the error body.message --------- Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
Summary
err.messageproperty is not populatedVerified locally that now
Bad Requesttext is actually changed with the error body.message