Skip to content

Commit b0ea214

Browse files
bchapuisclaude
andcommitted
Include refresh failure reason in OAuth expiration error message
Surfaces the actual provider error (e.g. Reddit API response) in the thrown exception so it appears in execution output, not just worker logs. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent f5ddc63 commit b0ea214

3 files changed

Lines changed: 6 additions & 6 deletions

File tree

apps/api/src/runtime/cloudflare-credential-service.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -235,13 +235,16 @@ export class CloudflareCredentialService implements CredentialService {
235235

236236
return newAccessToken;
237237
} catch (error) {
238+
const reason = error instanceof Error ? error.message : String(error);
238239
console.error(
239240
`[OAuth] Failed to refresh: ${provider} (${integrationId})`,
240241
error
241242
);
242243

243244
await this.markIntegrationExpired(db, integrationId);
244-
throw new Error("Integration has expired. Please reconnect in settings.");
245+
throw new Error(
246+
`Integration has expired. Please reconnect in settings. (Refresh failed: ${reason})`
247+
);
245248
}
246249
}
247250

apps/app/src/components/schema-dialog.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,8 +137,7 @@ function FieldEditor({ fields, onChange }: FieldEditorProps) {
137137
onChange(
138138
fields.map((f, i) => ({
139139
...f,
140-
primaryKey:
141-
i === index ? true : undefined,
140+
primaryKey: i === index ? true : undefined,
142141
}))
143142
);
144143
}

apps/app/src/components/workflow/widgets/input/schema-compose-input.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -82,9 +82,7 @@ function SchemaComposeInputWidget({
8282
// Build the schema input from scratch to avoid race conditions
8383
// between competing input updates (onChange vs updateNodeData)
8484
updateNodeData(nodeId, (current) => {
85-
const existingSchema = current.inputs?.find(
86-
(i) => i.id === "schema"
87-
);
85+
const existingSchema = current.inputs?.find((i) => i.id === "schema");
8886
const schemaInput = {
8987
...(existingSchema ?? {
9088
id: "schema",

0 commit comments

Comments
 (0)