There's the getStackTrace() function that gets stack trace from the current exception.
But it doesn't work for specific exception, this code won't work error.getStackTrace()
I need it for log function
proc error*(message: string, exception: Exception): void =
stderr.write_line fmt" {message}"
stderr.write_line exception.getStackTrace()