-
Notifications
You must be signed in to change notification settings - Fork 58
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work! Lots of new tests! I just want to remove "transient" :)
swagger/function-manager.yaml
Outdated
type: array | ||
items: | ||
type: string | ||
transient: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I talked to @imikushin about this property. I'd like us to remove it as it's just going to be confusing and REALLY hard to get right.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few changes. Thanks for making this happen!
swagger/event-manager.yaml
Outdated
@@ -832,7 +832,7 @@ definitions: | |||
type: integer | |||
message: | |||
type: string | |||
user-error: | |||
input-error: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd remove 'input-error' and 'function-error' fields from event-manager API: by checking their generated code usages, I see they're not used anywhere.
Also, they break our field naming convention (camelCase).
|
||
run.Error = ctx.GetError() | ||
if run.Error != nil { | ||
return errors.Wrapf(&invocationError{run.Error}, "error running function: %s", run.FunctionName) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Error stacktrace seems to be getting lost while recording the result of the function invocation
pkg/functions/openfaas/driver.go
Outdated
} | ||
var out functions.Message | ||
if err := json.Unmarshal(resBytes, &out); err != nil { | ||
return nil, errors.Errorf("cannot JSON-parse result from OpenFaaS: %s %s", err, string(resBytes)) | ||
return nil, &outputError{errors.Errorf("cannot JSON-parse result from OpenFaaS: %s %s", err, string(resBytes))} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This one is a system error too: it's the function runtime responsible for JSON-encoding the response, not the function.
pkg/functions/riff/driver.go
Outdated
} | ||
|
||
var out functions.Message | ||
if err := json.Unmarshal(resBytes, &out); err != nil { | ||
return nil, errors.Errorf("cannot JSON-parse result from riff: %s %s", err, string(resBytes)) | ||
return nil, &outputError{errors.Errorf("cannot JSON-parse result from riff: %s %s", err, string(resBytes))} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This one is a system error too: it's the function runtime responsible for JSON-encoding the response, not the function.
82d3a3e
to
331209e
Compare
@rjew can you rebase after the big model refactor |
Sure working on it now |
Implement error handling types: InputError, FunctionError, SystemError.
Fixes #356, Fixes #403