From 152ddd9dd8fdc360ec48926836ed278f0f74370f Mon Sep 17 00:00:00 2001 From: Petr Pucil Date: Sat, 21 Mar 2020 22:08:21 +0100 Subject: [PATCH] Add UndecidedEndiannessError --- KaitaiStruct.cs | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/KaitaiStruct.cs b/KaitaiStruct.cs index b783933..3e57143 100644 --- a/KaitaiStruct.cs +++ b/KaitaiStruct.cs @@ -36,6 +36,26 @@ namespace Kaitai byte[] Decode(byte[] src); } + /// + /// Error that occurs when default endianness should be decided with a + /// switch, but nothing matches (although using endianness expression + /// implies that there should be some positive result). + /// + public class UndecidedEndiannessError : Exception { + public UndecidedEndiannessError() + : base("Unable to decide on endianness") + { + } + public UndecidedEndiannessError(string msg) + : base(msg) + { + } + public UndecidedEndiannessError(string msg, Exception inner) + : base(msg, inner) + { + } + } + /// /// Common ancestor for all error originating from Kaitai Struct usage. /// Stores KSY source path, pointing to an element supposedly guilty of