Skip to content

Commit

Permalink
fix gcp invoke
Browse files Browse the repository at this point in the history
  • Loading branch information
tsuf239 committed Jul 18, 2024
1 parent 98de4ad commit 98c934e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions examples/tests/sdk_tests/function/aws-function.test.w
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ let fn = new cloud.Function(inflight (msg: Json?) => {

let fnInfo = getFunctionInfo(fn);

test "AWS Function" {
new std.Test(inflight () => {
if let info = fnInfo {
if target == "tf-aws" {
assert(info.get("functionArn").contains("arn:aws:lambda:"));
Expand Down Expand Up @@ -73,4 +73,4 @@ test "AWS Function" {
msg = err;
}
expect.ok(msg.contains("fake error"), "Expected fake error message");
}
}, timeout: 3m) as "AWS Function";
3 changes: 2 additions & 1 deletion libs/wingsdk/src/shared-gcp/function.inflight.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,8 @@ export class FunctionClient implements IFunctionClient {
},
},
});
return (res.data as Json | undefined) ?? undefined;
/// The gcp call return "" even for an undefined call
return (res.data as undefined | Json) || undefined;
} catch (error) {
throw new Error(
`Error while invoking the function ${this.functionName}:\n${
Expand Down

0 comments on commit 98c934e

Please sign in to comment.