Some error management... hopefully

This commit is contained in:
Nicolò P 2024-01-29 17:34:32 +01:00
parent ceceb69b3f
commit a43e6fb57f
3 changed files with 11 additions and 3 deletions

View File

@ -34,7 +34,15 @@ namespace Txt2Bib
return; return;
} }
var txt2bib = new Text2Bib(); 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; Debug.Text = result;
using var outputFile = new StreamWriter($@"{OutputDir}\output_bibtex.bib"); using var outputFile = new StreamWriter($@"{OutputDir}\output_bibtex.bib");
outputFile.Write(result); outputFile.Write(result);

View File

@ -52,7 +52,7 @@ namespace Txt2Bib
} }
catch (Exception) catch (Exception)
{ {
throw; throw new Exception($"Errore di elaborazione in {entries.Last()}");
} }
var bibtex = ""; var bibtex = "";

View File

@ -5,7 +5,7 @@
<TargetFramework>net6.0-windows</TargetFramework> <TargetFramework>net6.0-windows</TargetFramework>
<Nullable>enable</Nullable> <Nullable>enable</Nullable>
<UseWPF>true</UseWPF> <UseWPF>true</UseWPF>
<Version>0.1.6</Version> <Version>0.1.7</Version>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>