-
Notifications
You must be signed in to change notification settings - Fork 2.9k
[NIFI-13099] status history error handling #8703
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
mcgilman
merged 12 commits into
apache:main
from
rfellows:NIFI-13099-statusHistoryErrorHandling
Apr 29, 2024
Merged
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
d51dcd8
[NIFI-13099] - Error handling for Status History
rfellows bcc6c7f
Error handling for current user
rfellows 2b007b1
Error handling for extension types
rfellows b4bce06
Error handling for flow configuration
rfellows 95cc8a7
Error handling for component state
rfellows 077fa3e
Error handling for cluster summary
rfellows 959ad40
Error handling for System Diagnostics
rfellows 263e43f
review feedback
rfellows 7682cca
use SystemDiagnosticsActions.systemDiagnosticsSnackbarError
rfellows 2fb3aca
review feedback
rfellows f0e23cd
review feedback
rfellows ed92c6a
use snackbar
rfellows File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -21,14 +21,16 @@ import { concatLatestFrom } from '@ngrx/operators'; | |
| import { Store } from '@ngrx/store'; | ||
| import { NiFiState } from '../index'; | ||
| import * as ComponentStateActions from './component-state.actions'; | ||
| import { resetComponentState } from './component-state.actions'; | ||
| import { catchError, from, map, of, switchMap, tap } from 'rxjs'; | ||
| import { MatDialog } from '@angular/material/dialog'; | ||
| import { ComponentStateService } from '../../service/component-state.service'; | ||
| import { ComponentStateDialog } from '../../ui/common/component-state/component-state.component'; | ||
| import { resetComponentState } from './component-state.actions'; | ||
| import { selectComponentUri } from './component-state.selectors'; | ||
| import { isDefinedAndNotNull } from '../shared'; | ||
| import { LARGE_DIALOG } from '../../index'; | ||
| import * as ErrorActions from '../error/error.actions'; | ||
| import { HttpErrorResponse } from '@angular/common/http'; | ||
|
|
||
| @Injectable() | ||
| export class ComponentStateEffects { | ||
|
|
@@ -53,10 +55,12 @@ export class ComponentStateEffects { | |
| } | ||
| }) | ||
| ), | ||
| catchError((error) => | ||
| catchError((errorResponse: HttpErrorResponse) => | ||
| of( | ||
| ComponentStateActions.componentStateApiError({ | ||
| error: error.error | ||
| ErrorActions.snackBarError({ | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should this be a banner when it happens following |
||
| error: `Failed to get the component state for ${request.componentName}. - [${ | ||
| errorResponse.error || errorResponse.status | ||
| }]` | ||
| }) | ||
| ) | ||
| ) | ||
|
|
@@ -99,10 +103,12 @@ export class ComponentStateEffects { | |
| from( | ||
| this.componentStateService.clearComponentState({ componentUri }).pipe( | ||
| map(() => ComponentStateActions.reloadComponentState()), | ||
| catchError((error) => | ||
| catchError((errorResponse: HttpErrorResponse) => | ||
| of( | ||
| ComponentStateActions.componentStateApiError({ | ||
| error: error.error | ||
| ErrorActions.addBannerError({ | ||
| error: `Failed to clear the component state. - [${ | ||
| errorResponse.error || errorResponse.status | ||
| }]` | ||
| }) | ||
| ) | ||
| ) | ||
|
|
@@ -126,10 +132,12 @@ export class ComponentStateEffects { | |
| } | ||
| }) | ||
| ), | ||
| catchError((error) => | ||
| catchError((errorResponse: HttpErrorResponse) => | ||
| of( | ||
| ComponentStateActions.componentStateApiError({ | ||
| error: error.error | ||
| ErrorActions.addBannerError({ | ||
| error: `Failed to reload the component state. - [${ | ||
| errorResponse.error || errorResponse.status | ||
| }]` | ||
| }) | ||
| ) | ||
| ) | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
concatLatestFromis imported from the wrong package. I also noticed thatsystemDiagnosticsServiceis injected in the constructor here but is not used anymore.