Skip to content

Commit b9660d3

Browse files
committed
improve error handling
1 parent 3aea15a commit b9660d3

File tree

3 files changed

+24
-4
lines changed

3 files changed

+24
-4
lines changed

components/fireflies/actions/find-meeting-by-id/find-meeting-by-id.mjs

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
import fireflies from "../../fireflies.app.mjs";
22
import queries from "../../common/queries.mjs";
3+
import { ConfigurationError } from "@pipedream/platform";
34

45
export default {
56
key: "fireflies-find-meeting-by-id",
67
name: "Find Meeting by ID",
78
description: "Locates a specific user meeting by its unique ID. [See the documentation](https://docs.fireflies.ai/graphql-api/query/transcript)",
8-
version: "0.0.1",
9+
version: "0.0.2",
910
type: "action",
1011
props: {
1112
fireflies,
@@ -17,6 +18,10 @@ export default {
1718
},
1819
},
1920
async run({ $ }) {
21+
if (!this.meetingId) {
22+
throw new ConfigurationError("Meeting ID is required");
23+
}
24+
2025
const meeting = await this.fireflies.query({
2126
$,
2227
data: {
@@ -26,6 +31,11 @@ export default {
2631
},
2732
},
2833
});
34+
35+
if (meeting.errors?.length) {
36+
throw new ConfigurationError(`Error: ${meeting.errors[0].message}`);
37+
}
38+
2939
$.export("$summary", `Successfully found meeting with ID: ${this.meetingId}`);
3040
return meeting;
3141
},

components/fireflies/actions/find-recent-meeting/find-recent-meeting.mjs

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
import fireflies from "../../fireflies.app.mjs";
22
import queries from "../../common/queries.mjs";
3+
import { ConfigurationError } from "@pipedream/platform";
34

45
export default {
56
key: "fireflies-find-recent-meeting",
67
name: "Find Recent Meeting",
78
description: "Retrieves the most recent meeting for a user. [See the documentation](https://docs.fireflies.ai/graphql-api/query/user)",
8-
version: "0.0.1",
9+
version: "0.0.2",
910
type: "action",
1011
props: {
1112
fireflies,
@@ -17,6 +18,10 @@ export default {
1718
},
1819
},
1920
async run({ $ }) {
21+
if (!this.userId) {
22+
throw new ConfigurationError("User ID is required");
23+
}
24+
2025
const { data: { user: { recent_meeting: meetingId } } } = await this.fireflies.query({
2126
$,
2227
data: {
@@ -39,6 +44,11 @@ export default {
3944
},
4045
},
4146
});
47+
48+
if (meeting.errors?.length) {
49+
throw new ConfigurationError(`Error: ${meeting.errors[0].message}`);
50+
}
51+
4252
$.export("$summary", `Successfully fetched the most recent meeting for user with ID ${this.userId}`);
4353
return meeting;
4454
},

components/fireflies/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@pipedream/fireflies",
3-
"version": "0.1.0",
3+
"version": "0.1.1",
44
"description": "Pipedream Fireflies Components",
55
"main": "fireflies.app.mjs",
66
"keywords": [
@@ -13,6 +13,6 @@
1313
"access": "public"
1414
},
1515
"dependencies": {
16-
"@pipedream/platform": "^1.6.2"
16+
"@pipedream/platform": "^3.0.3"
1717
}
1818
}

0 commit comments

Comments
 (0)