From 254d91dcdfb0452d90db4934085b12532d8801ec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B6nke=20Ludwig?= Date: Sat, 15 Jul 2017 10:12:52 +0200 Subject: [PATCH] Improve error message. --- source/vibe/core/task.d | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/source/vibe/core/task.d b/source/vibe/core/task.d index 1a3af74..2a4c397 100644 --- a/source/vibe/core/task.d +++ b/source/vibe/core/task.d @@ -515,13 +515,15 @@ package struct TaskFuncInfo { import std.algorithm : move; import std.traits : hasElaborateAssign; + import std.conv : to; static struct TARGS { ARGS expand; } - static assert(CALLABLE.sizeof <= TaskFuncInfo.callable.length); + static assert(CALLABLE.sizeof <= TaskFuncInfo.callable.length, + "Storage required for task callable is too large ("~CALLABLE.sizeof~" vs max "~callable.length~"): "~CALLABLE.stringof); static assert(TARGS.sizeof <= maxTaskParameterSize, "The arguments passed to run(Worker)Task must not exceed "~ - maxTaskParameterSize.to!string~" bytes in total size."); + maxTaskParameterSize.to!string~" bytes in total size: "~TARGS.sizeof.stringof~" bytes"); static void callDelegate(ref TaskFuncInfo tfi) { assert(tfi.func is &callDelegate, "Wrong callDelegate called!?");