build an error from the definition, skipping the first frames of the call stack.
(d *Definition, skip int)
| 96 | |
| 97 | // build an error from the definition, skipping the first frames of the call stack. |
| 98 | func build(d *Definition, skip int) *Error { |
| 99 | e := Error{ |
| 100 | Definition: d, |
| 101 | grpcStatus: new(atomic.Value), |
| 102 | } |
| 103 | if generateCorrelationIDs { |
| 104 | u := uuid.New() |
| 105 | e.correlationID = hex.EncodeToString(u[:]) |
| 106 | } |
| 107 | if skip > 0 { |
| 108 | e.stack = callers(skip) |
| 109 | } |
| 110 | return &e |
| 111 | } |
| 112 | |
| 113 | // New exists in order to prevent accidentally calling Definition.New(). |
| 114 | // If you are sure that you want to create a fresh error, use .Definition.New(). |
no test coverage detected