Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion apps/desktop/src/lib/trpc/routers/plugins/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { rethrowCloudUnreachable } from "@superset/host-service/cloud-api-error";
import { isOrganizationMarketplace } from "@superset/shared/plugins";
import { TRPCError } from "@trpc/server";
import {
Expand Down Expand Up @@ -131,7 +132,12 @@ export const createPluginsRouter = () => {
z.object({ organizationId: z.string().min(1).optional() }).optional(),
)
.mutation(async ({ input }) => {
await syncPlugins(input?.organizationId);
try {
await syncPlugins(input?.organizationId);
} catch (error) {
rethrowCloudUnreachable(error);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2: rethrowCloudUnreachable only sees errors that escape syncPlugins, but reconcileOrganizationPlugins catches each bundle-download failure and replaces it with a plain aggregate error. A connection drop during plugin download therefore still reaches this mutation as a 500/Sentry event; preserve the transport cause or classify that failure before aggregating it.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At apps/desktop/src/lib/trpc/routers/plugins/index.ts, line 138:

<comment>`rethrowCloudUnreachable` only sees errors that escape `syncPlugins`, but `reconcileOrganizationPlugins` catches each bundle-download failure and replaces it with a plain aggregate error. A connection drop during plugin download therefore still reaches this mutation as a 500/Sentry event; preserve the transport cause or classify that failure before aggregating it.</comment>

<file context>
@@ -131,7 +132,12 @@ export const createPluginsRouter = () => {
+				try {
+					await syncPlugins(input?.organizationId);
+				} catch (error) {
+					rethrowCloudUnreachable(error);
+					throw error;
+				}
</file context>

throw error;
}
return { ok: true };
}),
});
Expand Down
4 changes: 4 additions & 0 deletions packages/host-service/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,10 @@
"types": "./src/trpc/router/settings/index.ts",
"default": "./src/trpc/router/settings/index.ts"
},
"./cloud-api-error": {
"types": "./src/trpc/router/host/cloud-api-error.ts",
"default": "./src/trpc/router/host/cloud-api-error.ts"
},
"./attachments": {
"types": "./src/trpc/router/attachments/index.ts",
"default": "./src/trpc/router/attachments/index.ts"
Expand Down
Loading