import std.string : representation;
import std.exception : assumeUnique;
class MyException : Exception {
@trusted private string annotate(string msg) {
immutable a = msg.representation;
immutable b = annotation().representation;
assert(a.length + b.length + 1 < buffer.length);
buffer[0 .. a.length] = a;
buffer[a.length+1 .. a.length+1+b.length] = b;
return assumeUnique(cast(char[])buffer);
this(string msg, string file = __FILE__, size_t line = __LINE__, Throwable nextInChain = null) {
super(annotate(msg), file, line, nextInChain);
this(string msg, Throwable nextInChain, string file = __FILE__, size_t line = __LINE__) {
super(msg, file, line, nextInChain);
throw new MyException("hi");