Skip to content

Commit f5f5562

Browse files
committed
fix: include domain in error message for unpublish
1 parent a175f1a commit f5f5562

File tree

3 files changed

+10
-4
lines changed

3 files changed

+10
-4
lines changed

apps/builder/app/builder/features/topbar/domains.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ const DomainItem = ({
205205
});
206206

207207
if (result.success === false) {
208-
toast.error(result.error);
208+
toast.error(result.message);
209209
return;
210210
}
211211

apps/builder/app/builder/features/topbar/publish.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ const ChangeProjectDomain = ({
160160
domain: project.domain,
161161
});
162162
if (result.success === false) {
163-
toast.error(result.error);
163+
toast.error(result.message);
164164
return;
165165
}
166166
await refresh();

packages/domain/src/trpc/domain.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -179,15 +179,21 @@ export const domainRouter = router({
179179

180180
// If worker deletion failed (and not NOT_IMPLEMENTED), return error
181181
if (result.success === false && result.error !== "NOT_IMPLEMENTED") {
182-
return result;
182+
return {
183+
success: false,
184+
message: `Failed to unpublish ${input.domain}`,
185+
} as const;
183186
}
184187

185188
return {
186189
success: true,
187190
message: `${input.domain} unpublished`,
188191
} as const;
189192
} catch (error) {
190-
return createErrorResponse(error);
193+
return {
194+
success: false,
195+
message: `Failed to unpublish ${input.domain}`,
196+
} as const;
191197
}
192198
}),
193199
/**

0 commit comments

Comments
 (0)