Implement TaskError, which gets a copy of the current stack.