Skip to content
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

Redesigned error boundary #339

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions AudioCuesheetEditor/Resources/Localization/MainLayout/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"translations": {
"About": "Über",
"An error occured": "Ein Fehler ist aufgetreten!",
"An error has occured in this applciation. Please report this error with as much details as possible here. Afterwards you can reload the application.": "Es ist ein Fehler in der Anwendung aufgetreten. Bitte melden Sie diesen Fehler unter Angabe von möglichst vielen Details hier: <a href=\"https://github.com/NeoCoderMatrix86/AudioCuesheetEditor/issues/new?assignees=&labels=unreviewed+bug&template=bug_report.md&title=\" target=\"_blank\">https://github.com/NeoCoderMatrix86/AudioCuesheetEditor/issues/new?assignees=&labels=unreviewed+bug&template=bug_report.md&title=</a>. Anschließend können Sie die Anwendung <a href=\"\" class=\"reload\">neu laden</a>.",
"An error has occured in this application. Please report this error with as much details as possible here: <a href=\"https://github.com/NeoCoderMatrix86/AudioCuesheetEditor/issues/new?assignees=&labels=bug&template=bug_report.md&title=\" target=\"_blank\">https://github.com/NeoCoderMatrix86/AudioCuesheetEditor/issues/new?assignees=&labels=unreviewed+bug&template=bug_report.md&title=</a>.": "Es ist ein Fehler in der Anwendung aufgetreten. Bitte melden Sie diesen Fehler unter Angabe von möglichst vielen Details hier: <a href=\"https://github.com/NeoCoderMatrix86/AudioCuesheetEditor/issues/new?assignees=&labels=unreviewed+bug&template=bug_report.md&title=\" target=\"_blank\">https://github.com/NeoCoderMatrix86/AudioCuesheetEditor/issues/new?assignees=&labels=unreviewed+bug&template=bug_report.md&title=</a>.",
"Help": "Hilfe",
"Undo last change": "Letzte Änderung Rückgängig machen",
"Redo last change": "Letzte Änderung wiederherstellen",
Expand Down Expand Up @@ -69,6 +69,8 @@
"Length": "Länge",
"Flags": "Markierungen",
"PreGap": "Vorlücke",
"PostGap": "Nachlücke"
"PostGap": "Nachlücke",
"Error details": "Fehlerdetails",
"Reload application": "Applikation neu laden"
}
}
6 changes: 4 additions & 2 deletions AudioCuesheetEditor/Resources/Localization/MainLayout/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"translations": {
"About": "About",
"An error occured": "An error has occured!",
"An error has occured in this applciation. Please report this error with as much details as possible here. Afterwards you can reload the application.": "An error has occured in this applciation. Please report this error with as much details as possible here: <a href=\"https://github.com/NeoCoderMatrix86/AudioCuesheetEditor/issues/new?assignees=&labels=unreviewed+bug&template=bug_report.md&title=\" target=\"_blank\">https://github.com/NeoCoderMatrix86/AudioCuesheetEditor/issues/new?assignees=&labels=unreviewed+bug&template=bug_report.md&title=</a>. Afterwards you can <a href=\"\" class=\"reload\">reload</a> the application.",
"An error has occured in this application. Please report this error with as much details as possible here: <a href=\"https://github.com/NeoCoderMatrix86/AudioCuesheetEditor/issues/new?assignees=&labels=bug&template=bug_report.md&title=\" target=\"_blank\">https://github.com/NeoCoderMatrix86/AudioCuesheetEditor/issues/new?assignees=&labels=unreviewed+bug&template=bug_report.md&title=</a>.": "An error has occured in this application. Please report this error with as much details as possible here: <a href=\"https://github.com/NeoCoderMatrix86/AudioCuesheetEditor/issues/new?assignees=&labels=bug&template=bug_report.md&title=\" target=\"_blank\">https://github.com/NeoCoderMatrix86/AudioCuesheetEditor/issues/new?assignees=&labels=unreviewed+bug&template=bug_report.md&title=</a>.",
"Help": "Help",
"Undo last change": "Undo last change",
"Redo last change": "Redo last change",
Expand Down Expand Up @@ -69,6 +69,8 @@
"Length": "Length",
"Flags": "Flags",
"PreGap": "Pregap",
"PostGap": "Postgap"
"PostGap": "Postgap",
"Error details": "Error details",
"Reload application": "Reload application"
}
}
16 changes: 12 additions & 4 deletions AudioCuesheetEditor/Shared/MainLayout.razor
Original file line number Diff line number Diff line change
Expand Up @@ -170,8 +170,11 @@ along with Foobar. If not, see
</CascadingValue>
</ChildContent>
<ErrorContent>
<Heading Size="HeadingSize.Is3" TextColor="TextColor.Danger">@_localizer["An error occured"]</Heading>
<Paragraph>@((MarkupString)_localizer["An error has occured in this applciation. Please report this error with as much details as possible here. Afterwards you can reload the application."])</Paragraph>
<Heading Size="HeadingSize.Is2" TextColor="TextColor.Danger">@_localizer["An error occured"]</Heading>
<Paragraph>@((MarkupString)_localizer["An error has occured in this application. Please report this error with as much details as possible here: <a href=\"https://github.com/NeoCoderMatrix86/AudioCuesheetEditor/issues/new?assignees=&labels=bug&template=bug_report.md&title=\" target=\"_blank\">https://github.com/NeoCoderMatrix86/AudioCuesheetEditor/issues/new?assignees=&labels=unreviewed+bug&template=bug_report.md&title=</a>."])</Paragraph>
<Heading Size="HeadingSize.Is4">@_localizer["Error details"]</Heading>
<Paragraph>@context</Paragraph>
<Button Color="Color.Primary" Clicked="ReloadApplication">@_localizer["Reload application"]</Button>
</ErrorContent>
</ErrorBoundary>

Expand Down Expand Up @@ -560,8 +563,7 @@ along with Foobar. If not, see
{
_logger.LogInformation("restartApplicationDelegate");
modalDialog.Confirmed -= restartApplicationDelegate;
await _jsRuntime.InvokeVoidAsync("removeBeforeunload");
_navigationManager.NavigateTo(_navigationManager.Uri, true);
await ReloadApplication();
};
modalDialog.Confirmed += restartApplicationDelegate;
await modalDialog.ShowModal();
Expand Down Expand Up @@ -844,4 +846,10 @@ along with Foobar. If not, see
}
return Task.CompletedTask;
}

async Task ReloadApplication()
{
await _jsRuntime.InvokeVoidAsync("removeBeforeunload");
_navigationManager.NavigateTo(_navigationManager.Uri, true);
}
}