1 module dimage.exceptions; 2 3 /** 4 * Thrown if image is being read or written out of bounds. 5 */ 6 class ImageBoundsException : Exception { 7 @nogc @safe pure nothrow this(string msg, string file = __FILE__, size_t line = __LINE__, Throwable nextInChain = null) 8 { 9 super(msg, file, line, nextInChain); 10 } 11 12 @nogc @safe pure nothrow this(string msg, Throwable nextInChain, string file = __FILE__, size_t line = __LINE__) 13 { 14 super(msg, file, line, nextInChain); 15 } 16 } 17 /** 18 * Thrown if palette is being read or written out of bounds. 19 */ 20 class PaletteBoundsException : Exception { 21 @nogc @safe pure nothrow this(string msg, string file = __FILE__, size_t line = __LINE__, Throwable nextInChain = null) 22 { 23 super(msg, file, line, nextInChain); 24 } 25 26 @nogc @safe pure nothrow this(string msg, Throwable nextInChain, string file = __FILE__, size_t line = __LINE__) 27 { 28 super(msg, file, line, nextInChain); 29 } 30 } 31 /** 32 * Thrown if image format doesn't match. 33 */ 34 class ImageFormatException : Exception { 35 @nogc @safe pure nothrow this(string msg, string file = __FILE__, size_t line = __LINE__, Throwable nextInChain = null) 36 { 37 super(msg, file, line, nextInChain); 38 } 39 40 @nogc @safe pure nothrow this(string msg, Throwable nextInChain, string file = __FILE__, size_t line = __LINE__) 41 { 42 super(msg, file, line, nextInChain); 43 } 44 } 45 /** 46 * Thrown on image file reading/writing errors. 47 */ 48 class ImageFileException : Exception { 49 @nogc @safe pure nothrow this(string msg, string file = __FILE__, size_t line = __LINE__, Throwable nextInChain = null) 50 { 51 super(msg, file, line, nextInChain); 52 } 53 54 @nogc @safe pure nothrow this(string msg, Throwable nextInChain, string file = __FILE__, size_t line = __LINE__) 55 { 56 super(msg, file, line, nextInChain); 57 } 58 } 59 /** 60 * Thrown if compression error is encountered with a file. 61 */ 62 public class ImageFileCompressionException : ImageFileException { 63 @nogc @safe pure nothrow this(string msg, string file = __FILE__, size_t line = __LINE__, Throwable nextInChain = null) 64 { 65 super(msg, file, line, nextInChain); 66 } 67 68 @nogc @safe pure nothrow this(string msg, Throwable nextInChain, string file = __FILE__, size_t line = __LINE__) 69 { 70 super(msg, file, line, nextInChain); 71 } 72 } 73 /** 74 * Thrown if the file has a checksum error. 75 */ 76 public class ChecksumMismatchException : ImageFileException { 77 @nogc @safe pure nothrow this(string msg, string file = __FILE__, size_t line = __LINE__, Throwable nextInChain = null) 78 { 79 super(msg, file, line, nextInChain); 80 } 81 82 @nogc @safe pure nothrow this(string msg, Throwable nextInChain, string file = __FILE__, size_t line = __LINE__) 83 { 84 super(msg, file, line, nextInChain); 85 } 86 }