Wrap creates a new XError and copy message and id to new one.
(cause error)
| 113 | |
| 114 | // Wrap creates a new XError and copy message and id to new one. |
| 115 | func (e *XError) Wrap(cause error) *XError { |
| 116 | err := newXError() |
| 117 | e.copy(err) |
| 118 | err.cause = cause |
| 119 | return err |
| 120 | } |
| 121 | |
| 122 | // Unwrap compatible with github.com/pkg/errors |
| 123 | func (e *XError) Unwrap() error { |