Skip to content

Commit

Permalink
chore: simplify error title
Browse files Browse the repository at this point in the history
  • Loading branch information
WaDadidou committed Oct 21, 2024
1 parent 9801755 commit 1eba033
Showing 1 changed file with 8 additions and 12 deletions.
20 changes: 8 additions & 12 deletions packages/hooks/dao/useDAOProposalById.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,18 +91,16 @@ export const useDAOProposalById = (

return proposal;
} catch (err) {
const title =
"Failed to fetch the Gno DAO proposal\nThis proposal might not exist in this DAO";
const message = err instanceof Error ? err.message : `${err}`;
setToast({
title:
"Failed to fetch the Gno DAO proposal\nThis proposal might not exist in this DAO",
title,
message,
type: "error",
mode: "normal",
});
console.error(
"Failed to fetch the Gno DAO. This proposal might not exist in this DAO: ",
message,
);
console.error(title, message);
return null;
}
},
Expand Down Expand Up @@ -164,18 +162,16 @@ const useCosmWasmDAOProposalById = (

return proposal;
} catch (err) {
const title =
"Failed to fetch the Cosmos DAO proposal\nThis proposal might not exist in this DAO";
const message = err instanceof Error ? err.message : `${err}`;
setToast({
title:
"Failed to fetch the Cosmos DAO proposal\nThis proposal might not exist in this DAO",
title,
message,
type: "error",
mode: "normal",
});
console.error(
"Failed to fetch the Cosmos DAO proposal. This proposal might not exist in this DAO: ",
message,
);
console.error(title, message);
return null;
}
},
Expand Down

0 comments on commit 1eba033

Please sign in to comment.