From 41f673e65e70f0ac8dd63100023663508ddcb9f4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joachim=20Mairb=C3=B6ck?= Date: Mon, 28 Aug 2023 12:33:27 +0200 Subject: [PATCH] Improve exception when trying to load an invalid file --- HVIFControl/HVIFControl.vb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/HVIFControl/HVIFControl.vb b/HVIFControl/HVIFControl.vb index dfe83d7..fa4b0f0 100644 --- a/HVIFControl/HVIFControl.vb +++ b/HVIFControl/HVIFControl.vb @@ -41,7 +41,7 @@ Public Class HVIFControl Dim buffer = File.ReadAllBytes(value) Dim magic = BitConverter.ToInt32(buffer, 0) If magic <> &H6669636E Then - Throw New Exception() + Throw New FormatException("The icon is not in HVIF format") End If Dim styleCount = buffer(4) Dim offset = 5