Skip to content

Commit

Permalink
Backport proper exception handling in win32 system dialogs
Browse files Browse the repository at this point in the history
  • Loading branch information
maxkatz6 committed Jul 28, 2022
1 parent 7fb8c01 commit 2d2cd97
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/Windows/Avalonia.Win32/SystemDialogImpl.cs
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,8 @@ internal class SystemDialogImpl : ISystemDialogImpl
}
catch (COMException ex)
{
throw new Win32Exception(ex.HResult);
var message = new Win32Exception(ex.HResult).Message;
throw new COMException(message, ex);
}
})!;
}
Expand Down Expand Up @@ -176,7 +177,8 @@ internal class SystemDialogImpl : ISystemDialogImpl
}
catch (COMException ex)
{
throw new Win32Exception(ex.HResult);
var message = new Win32Exception(ex.HResult).Message;
throw new COMException(message, ex);
}
});
}
Expand Down

0 comments on commit 2d2cd97

Please sign in to comment.