1 /** 2 * Модуль содержит слассы ошибок и вспомогательные фунции 3 * 4 * Copyright: (c) 2015-2017, Milofon Project. 5 * License: Subject to the terms of the BSD license, as written in the included LICENSE.txt file. 6 * Author: <m.galanin@milofon.org> Maksim Galanin 7 * Date: 2018-02-21 8 */ 9 10 module dango.system.exception; 11 12 private 13 { 14 import std.exception : enforceEx, enforce; 15 16 import proped : Properties; 17 18 import vibe.core.log : logError; 19 } 20 21 22 mixin template ExceptionMixin() 23 { 24 this(string msg, string file = __FILE__, size_t line = __LINE__, Throwable next = null) 25 { 26 logError(msg); 27 super(msg, file, line, next); 28 } 29 } 30 31 32 /** 33 * Исключение конфигурации приложения 34 */ 35 class ConfigException : Exception 36 { 37 mixin ExceptionMixin!(); 38 } 39 40 41 alias configEnforce = enforceEx!(ConfigException);