import bc.string.format : nogcFormatTo;
import std.exception : assumeUnique;
class MyException : Exception {
@trusted private string annotate(string msg) {
const len = nogcFormatTo!"%s %s"(buffer, msg, this.annotation);
return buffer[0 .. len].assumeUnique;
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");