Finalize looks up the corresponding method error expression.
(a *GRPCEndpointExpr)
| 45 | |
| 46 | // Finalize looks up the corresponding method error expression. |
| 47 | func (e *GRPCErrorExpr) Finalize(a *GRPCEndpointExpr) { |
| 48 | var ee *ErrorExpr |
| 49 | switch p := e.Response.Parent.(type) { |
| 50 | case *GRPCEndpointExpr: |
| 51 | ee = p.MethodExpr.Error(e.Name) |
| 52 | case *GRPCServiceExpr: |
| 53 | ee = p.Error(e.Name) |
| 54 | case *GRPCExpr: |
| 55 | ee = Root.Error(e.Name) |
| 56 | } |
| 57 | e.ErrorExpr = ee |
| 58 | e.Response.Finalize(a, e.AttributeExpr) |
| 59 | } |
| 60 | |
| 61 | // Dup creates a copy of the error expression. |
| 62 | func (e *GRPCErrorExpr) Dup() *GRPCErrorExpr { |