Update toError() signature.

Also update so that if a source error is being wrapped then the stack
trace reflects the stack trace of the source error.