mirror of
https://github.com/fnproject/fn.git
synced 2022-10-28 21:29:17 +03:00
fn: remove error formatting in fireBeforeCall/fireAfterCall (#1317)
fmt.Errorf strips API errors in models, we should propagate the error directly.
This commit is contained in:
@@ -342,12 +342,7 @@ func (c *call) Start(ctx context.Context) error {
|
||||
}
|
||||
}
|
||||
|
||||
err := c.ct.fireBeforeCall(ctx, c.Model())
|
||||
if err != nil {
|
||||
return fmt.Errorf("BeforeCall: %v", err)
|
||||
}
|
||||
|
||||
return nil
|
||||
return c.ct.fireBeforeCall(ctx, c.Model())
|
||||
}
|
||||
|
||||
func (c *call) End(ctx context.Context, errIn error) error {
|
||||
@@ -378,8 +373,7 @@ func (c *call) End(ctx context.Context, errIn error) error {
|
||||
c.stderr.Close()
|
||||
|
||||
if err := c.ct.fireAfterCall(ctx, c.Model()); err != nil {
|
||||
return fmt.Errorf("AfterCall: %v", err)
|
||||
return err
|
||||
}
|
||||
|
||||
return errIn // original error, important for use in sync call returns
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user