From a43e6fb57f90905fd571aac4cb9cbc67a9a930b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20P?= Date: Mon, 29 Jan 2024 17:34:32 +0100 Subject: [PATCH] Some error management... hopefully --- MainWindow.xaml.cs | 10 +++++++++- Text2Bib.cs | 2 +- Txt2Bib.csproj | 2 +- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/MainWindow.xaml.cs b/MainWindow.xaml.cs index 7488684..b200f80 100644 --- a/MainWindow.xaml.cs +++ b/MainWindow.xaml.cs @@ -34,7 +34,15 @@ namespace Txt2Bib return; } var txt2bib = new Text2Bib(); - var result = txt2bib.Generate(DropArea.Text); + var result = ""; + try + { + result = txt2bib.Generate(DropArea.Text); + } + catch (Exception ex) + { + MessageBox.Show($"Errore di esecuzione: {ex.Message}"); + } Debug.Text = result; using var outputFile = new StreamWriter($@"{OutputDir}\output_bibtex.bib"); outputFile.Write(result); diff --git a/Text2Bib.cs b/Text2Bib.cs index 3e3e1fc..55c1121 100644 --- a/Text2Bib.cs +++ b/Text2Bib.cs @@ -52,7 +52,7 @@ namespace Txt2Bib } catch (Exception) { - throw; + throw new Exception($"Errore di elaborazione in {entries.Last()}"); } var bibtex = ""; diff --git a/Txt2Bib.csproj b/Txt2Bib.csproj index 3359435..cdbc233 100644 --- a/Txt2Bib.csproj +++ b/Txt2Bib.csproj @@ -5,7 +5,7 @@ net6.0-windows enable true - 0.1.6 + 0.1.7