Showing with 14 additions and 0 deletions.
  1. +14 −0 src/object.d
14 changes: 14 additions & 0 deletions src/object.d
Original file line number Diff line number Diff line change
Expand Up @@ -1658,6 +1658,7 @@ class Throwable : Object
sink("@"); sink(file);
sink("("); sink(sizeToTempString(line, tmpBuff, 10)); sink(")");

auto msg = message();
if (msg.length)
{
sink(": "); sink(msg);
Expand All @@ -1678,6 +1679,19 @@ class Throwable : Object
}
}
}

/**
* Get the message describing the error.
* Base behavior is to return the `Throwable.msg` field.
* Override to return some other error message.
*
* Returns:
* message
*/
const(char)[] message() const
{
return msg;
}
}


Expand Down