1 /** 2 Utilities related to errors and exceptions 3 */ 4 module dcord.util.errors; 5 6 import std.format; 7 8 /// Simple exception mixin for creating custom exceptions. 9 public mixin template ExceptionMixin() { 10 this(string msg = null, Throwable next = null) { super(msg, next); } 11 this(string msg, string file, size_t line, Throwable next = null) { 12 super(msg, file, line, next); 13 } 14 } 15 16 /// Base class for Dcord errors 17 class BaseError: Exception { 18 this(T...)(string msg, T args) { 19 super(format(msg, args)); 20 } 21 }