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