Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Throw PlatformNotSupportedException instead of the InvalidOperationException in Window's constructor
  • Loading branch information
ezioleq committed Oct 19, 2023
1 parent 334ed86 commit 9adfddb
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions NoiseEngine/Window.cs
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,11 @@ public Window(string? title, uint width, uint height, WindowSettings settings) {

if (!WindowInterop.Create(Id, title, width, height, new WindowSettingsRaw(settings)).TryGetValue(
out InteropHandle<Window> handle, out ResultError error
)) {
error.ThrowAndDispose();
))
{
Exception exception = error.ToException();
error.Dispose();
throw new PlatformNotSupportedException(exception.Message);
}

Handle = handle;
Expand Down

0 comments on commit 9adfddb

Please sign in to comment.