-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #78 from yatli/crash_report
Crash report
- Loading branch information
Showing
8 changed files
with
105 additions
and
11 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
This file contains 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 |
---|---|---|
@@ -0,0 +1,11 @@ | ||
namespace FVim | ||
|
||
type CrashReportSampleData() = | ||
member __.MainMessage = "Some error: some detailed error message.\nThis error is so bad that we have to bail out." | ||
member __.TipMessage = "\n\nIn case of fire,\n 1. git commit\n 2. git push\n 3. run\nThank you for your cooperation." | ||
member __.StackTrace = System.Collections.Generic.List [ | ||
"foo" | ||
"bar" | ||
"baz" | ||
] | ||
|
This file contains 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 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 |
---|---|---|
@@ -0,0 +1,23 @@ | ||
namespace FVim | ||
|
||
open ui | ||
open log | ||
open common | ||
|
||
type CrashReportViewModel(ex: exn) = | ||
inherit ViewModelBase() | ||
member __.MainMessage = | ||
ex.Message | ||
member __.StackTrace = | ||
ex.StackTrace.Split("\n") | ||
member __.TipMessage = | ||
let tip = | ||
match ex.Message with | ||
| "The system cannot find the file specified." -> "Tip: check your neovim installation. `nvim` is not in your $PATH.\n" | ||
| _ -> "" | ||
let generic_message = | ||
"You can go to /~https://github.com/yatli/fvim/issues, and search\n" + | ||
"for relevant issues with the exception message, or the stack trace.\n" + | ||
"Feel free to create new issues, and I'll help to triage and fix the problem." | ||
tip + generic_message | ||
|
This file contains 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 |
---|---|---|
@@ -0,0 +1,34 @@ | ||
<Window xmlns="/~https://github.com/avaloniaui" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | ||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" | ||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" | ||
xmlns:fvim="clr-namespace:FVim;assembly=FVim" | ||
Focusable="True" | ||
MinHeight="240" | ||
MinWidth="600" | ||
Icon="..\Assets\fvim.png" | ||
x:Class="FVim.CrashReport"> | ||
<Design.DataContext> | ||
<fvim:CrashReportSampleData /> | ||
</Design.DataContext> | ||
<Grid> | ||
<Grid.RowDefinitions> | ||
<RowDefinition Height="20" /> | ||
<RowDefinition Height="40" /> | ||
<RowDefinition Height="*" /> | ||
<RowDefinition Height="50" /> | ||
</Grid.RowDefinitions> | ||
<Grid.ColumnDefinitions> | ||
<ColumnDefinition Width="120" /> | ||
<ColumnDefinition Width="400" /> | ||
<ColumnDefinition Width="*"/> | ||
</Grid.ColumnDefinitions> | ||
<TextBlock Text="FVim exited unexpectedly." Grid.Row="0" Grid.Column="1" Margin="0,10,0,0" FontWeight="Bold"/> | ||
<TextBlock Text="Close this window to exit FVim." Grid.Row="3" Grid.Column="1" Margin="0,10,0,0" FontWeight="Bold"/> | ||
<Image Source="/Assets/error.png" Grid.Row="0" Grid.RowSpan="4" Grid.Column="0" Height="64" Margin="0,0,0,50" /> | ||
<TextBlock Text="{Binding MainMessage}" Grid.Row="1" Grid.Column="1" Margin="0,20,0,0" /> | ||
<TextBlock Text="{Binding TipMessage}" Grid.Row="2" Grid.Column="1" Margin="0,20,0,0" /> | ||
<TextBlock Text="Stack trace:" Grid.Row="0" Grid.Column="2" Margin="0,10,0,0"/> | ||
<ListBox Items="{Binding StackTrace}" Grid.Row="1" Grid.RowSpan="2" Grid.Column="2" Margin="10,10,10,10"/> | ||
</Grid> | ||
</Window> |
This file contains 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 |
---|---|---|
@@ -0,0 +1,13 @@ | ||
namespace FVim | ||
|
||
open ui | ||
open log | ||
open common | ||
open Avalonia.Markup.Xaml | ||
open Avalonia.Controls | ||
|
||
type CrashReport() as this = | ||
inherit Window() | ||
|
||
do | ||
AvaloniaXamlLoader.Load(this) |
This file contains 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