class Exception 
{
    public Message;
    public InnerException;
    public Exception(message,$inner)
    {
        this.Message = message;
        this.InnerException = inner;
    }

    public ToString()
    {
        var messagePart = $"{Class.Name(this)}: {this.Message}";
        if(InnerException != undefined && InnerException != null)
        {
            var innerEx = InnerException.ToString().Replace("\n","\n\t");
            return $"{messagePart}\nInner exception:\n{innerEx}";
        }
        return messagePart;
    }
}