Added automatic error handling to show a message box
This commit is contained in:
parent
32ebd69194
commit
925f777d36
15
I18N Commander/UI WinForms/ExtensionsError.cs
Normal file
15
I18N Commander/UI WinForms/ExtensionsError.cs
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
using Processor;
|
||||||
|
|
||||||
|
namespace UI_WinForms;
|
||||||
|
|
||||||
|
public static class ExtensionsError
|
||||||
|
{
|
||||||
|
public static ProcessorResult<TResult> ProcessError<TResult>(this ProcessorResult<TResult> result)
|
||||||
|
{
|
||||||
|
if (result.Successful)
|
||||||
|
return result;
|
||||||
|
|
||||||
|
MessageBox.Show(result.ErrorMessage, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user