Skip to content

Commit

Permalink
Remove error stacktrace for web errormodels
Browse files Browse the repository at this point in the history
  • Loading branch information
ajinkyaraj-23 committed Dec 6, 2024
1 parent 0e5cc09 commit 4c47c27
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,5 @@ docs/

storybook-static

# IDE
.idea
3 changes: 2 additions & 1 deletion apps/web/src/components/Menu/ErrorLogsMenu/ErrorLogsMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { errorsActions, useAppDispatch, useAppSelector } from "@umami/state";
import { useColor } from "../../../styles/useColor";
import { EmptyMessage } from "../../EmptyMessage";
import { DrawerContentWrapper } from "../DrawerContentWrapper";
import { handleTezError } from "@umami/utils";

export const ErrorLogsMenu = () => {
const color = useColor();
Expand Down Expand Up @@ -60,7 +61,7 @@ export const ErrorLogsMenu = () => {
</Text>
{errorLog.technicalDetails && (
<Text marginTop="12px" color={color("700")} size="sm">
{errorLog.technicalDetails}
{handleTezError({name: "unknown", message: errorLog.technicalDetails})}
</Text>
)}
</Flex>
Expand Down
5 changes: 4 additions & 1 deletion packages/utils/src/ErrorContext.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,10 @@ export const handleTezError = (err: Error): string | undefined => {
} else if (err.message.includes("staking_to_delegate_that_refuses_external_staking")) {
return "The baker you are trying to stake to does not accept external staking.";
} else if (err.message.includes("empty_implicit_delegated_contract")) {
return "Emptying an implicit delegated account is not allowed.";
return "Emptying an implicit delegated account is not allowed. End delegation before trying again.";
}
else {
return "Unknown error. Contact support team for more information.";
}
};

Expand Down

0 comments on commit 4c47c27

Please sign in to comment.