Skip to content

Commit 61be612

Browse files
authored
Propagate rejected promise from user function (#104)
1 parent fdd1497 commit 61be612

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

spec/providers/database.spec.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,11 +56,12 @@ describe('DatabaseBuilder', () => {
5656
expect(event.data.val()).to.deep.equal({foo: 'bar'});
5757
});
5858

59-
return handler({data:
60-
{
59+
return handler({
60+
data: {
6161
data: null,
6262
delta: {foo: 'bar'},
6363
},
64+
resource: 'projects/_/instances/subdomains/refs/users',
6465
} as any);
6566
});
6667

@@ -74,7 +75,7 @@ describe('DatabaseBuilder', () => {
7475
data: null,
7576
delta: 'hello',
7677
},
77-
resource: 'projects/_/instances/subdomains/refs/users/{id}',
78+
resource: 'projects/_/instances/subdomain/refs/users/{id}',
7879
params: {
7980
id: 'aUserId',
8081
},

src/cloud-functions.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ export function makeCloudFunction<EventData>({
8888
return result;
8989
}, err => {
9090
if (after) { after(event); };
91-
return err;
91+
return Promise.reject(err);
9292
});
9393
};
9494
cloudFunction.__trigger = {

0 commit comments

Comments
 (0)