Skip to content

Commit

Permalink
[poke] improve error message on FF failed change (#9617)
Browse files Browse the repository at this point in the history
* reload on FF change even if we get an error

* Revert "reload on FF change even if we get an error"

This reverts commit e229ca4.

* improve the error message
  • Loading branch information
aubin-tchoi authored Dec 23, 2024
1 parent 35457de commit 2a273f9
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions front/components/poke/features/columns.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -69,18 +69,15 @@ async function toggleFeatureFlag(
}),
});
if (!r.ok) {
throw new Error("Failed to disable feature.");
const error: { error: { message: string } } = await r.json();
throw new Error(error.error.message);
}

reload();
} catch (e) {
sendNotification({
title: "Error",
description: `An error occurred while toggling feature "${feature}": ${JSON.stringify(
e,
null,
2
)}`,
description: `An error occurred while toggling feature "${feature}": ${e}`,
type: "error",
});
}
Expand Down

0 comments on commit 2a273f9

Please sign in to comment.