displaying the backend error message to the Alerting Page#858
displaying the backend error message to the Alerting Page#858riysaxen-amzn wants to merge 2 commits intoopensearch-project:mainfrom
Conversation
There was a problem hiding this comment.
can you test out that the error is rendered correctly for 5-6 other error scenarios also?
One example:
AlertingException[[RrS6PI0BudBWHJcvaeqR-metadata-RbS6PI0BudBWHJcvZ-og-metadata]: version conflict, required seqNo [28], primary term [1]. current document has seqNo [29] and primary term [1]]; nested: Exception[org.opensearch.index.engine.VersionConflictEngineException: [RrS6PI0BudBWHJcvaeqR-metadata-RbS6PI0BudBWHJcvZ-og-metadata]: version conflict, required seqNo [28], primary term [1]. current document has seqNo [29] and primary term [1]]
@praveensameneni @sbcd90 you can add more errors if required
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #858 +/- ##
==========================================
- Coverage 31.34% 30.99% -0.35%
==========================================
Files 159 151 -8
Lines 5258 5123 -135
Branches 977 896 -81
==========================================
- Hits 1648 1588 -60
+ Misses 3436 3345 -91
- Partials 174 190 +16 ☔ View full report in Codecov by Sentry. |
eirsep
left a comment
There was a problem hiding this comment.
Plz update your error alert doc with below message and verify what is error being shown
AlertingException[[RrS6PI0BudBWHJcvaeqR-metadata-RbS6PI0BudBWHJcvZ-og-metadata]: version conflict, required seqNo [28], primary term [1]. current document has seqNo [29] and primary term [1]]; nested: Exception[org.opensearch.index.engine.VersionConflictEngineException: [RrS6PI0BudBWHJcvaeqR-metadata-RbS6PI0BudBWHJcvZ-og-metadata]: version conflict, required seqNo [28], primary term [1]. current document has seqNo [29] and primary term [1]]
|
| // Function to show the tooltip | ||
| showTooltip = (errorMessage) => { | ||
| this.setState({ isTooltipVisible: true, errorMessage }); | ||
| }; | ||
|
|
||
| // Function to hide the tooltip | ||
| hideTooltip = () => { | ||
| this.setState({ isTooltipVisible: false }); | ||
| }; |
There was a problem hiding this comment.
- Please make sure that we are not exposing any sensitive information with this change. Its a good practice to sanitize the error messages before exposing them to the customers.
- One recommendation would be to expose only customer-actionable errors, like 4xx for example. Providing internal errors might confuse the users.
e40c8ef to
c8fab2b
Compare
|
|
||
| <EuiModalBody> | ||
| <EuiIcon type="alert" size="l" /> | ||
| <p>{alertItem.error_message}</p> |
There was a problem hiding this comment.
What happens if the error_message is null?
There was a problem hiding this comment.
What happens if the
error_messageis null?
when the status is ERROR, the error_message ideally shouldn't be null but I will check this in the backend, or we can add another null check here.
There was a problem hiding this comment.
will be an empty string now
Signed-off-by: Riya Saxena <riysaxen@amazon.com>
c8fab2b to
2743992
Compare
Signed-off-by: Riya <69919272+riysaxen-amzn@users.noreply.github.com>

Description
The PR incorporates the backend response that the /alerts API returns for alerts in state of error and display the error message on the Alerts page of Security Analytics.
Change:
ERROR, With this PR, the error link will now be clickable, leading to the display of a modal. The modal will have backend errorResponse. [img attached for ref]Issues Resolved
[List any issues this PR will resolve]
Check List
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.