@@ -39,18 +39,18 @@ func startRuntimeAPILoop(ctx context.Context, api string, handler Handler) error
39
39
func handleInvoke (invoke * invoke , function * Function ) error {
40
40
functionRequest , err := convertInvokeRequest (invoke )
41
41
if err != nil {
42
- return fmt .Errorf ("unexpected error occured when parsing the invoke: %v" , err )
42
+ return fmt .Errorf ("unexpected error occurred when parsing the invoke: %v" , err )
43
43
}
44
44
45
45
functionResponse := & messages.InvokeResponse {}
46
46
if err := function .Invoke (functionRequest , functionResponse ); err != nil {
47
- return fmt .Errorf ("unexpected error occured when invoking the handler: %v" , err )
47
+ return fmt .Errorf ("unexpected error occurred when invoking the handler: %v" , err )
48
48
}
49
49
50
50
if functionResponse .Error != nil {
51
51
payload := safeMarshal (functionResponse .Error )
52
52
if err := invoke .failure (payload , contentTypeJSON ); err != nil {
53
- return fmt .Errorf ("unexpected error occured when sending the function error to the API: %v" , err )
53
+ return fmt .Errorf ("unexpected error occurred when sending the function error to the API: %v" , err )
54
54
}
55
55
if functionResponse .Error .ShouldExit {
56
56
return fmt .Errorf ("calling the handler function resulted in a panic, the process should exit" )
@@ -59,7 +59,7 @@ func handleInvoke(invoke *invoke, function *Function) error {
59
59
}
60
60
61
61
if err := invoke .success (functionResponse .Payload , contentTypeJSON ); err != nil {
62
- return fmt .Errorf ("unexpected error occured when sending the function functionResponse to the API: %v" , err )
62
+ return fmt .Errorf ("unexpected error occurred when sending the function functionResponse to the API: %v" , err )
63
63
}
64
64
65
65
return nil
0 commit comments