Skip to content

Commit

Permalink
fix: handling errors in a better way (#1354)
Browse files Browse the repository at this point in the history
  • Loading branch information
pedrorezende authored Dec 2, 2024
1 parent 231d0a0 commit 4e26466
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
5 changes: 2 additions & 3 deletions apps/namadillo/src/App/Common/InlineError.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import clsx from "clsx";
import React from "react";
import { GoXCircle } from "react-icons/go";

type InlineErrorProps = {
errorMessage?: React.ReactNode;
Expand All @@ -13,10 +12,10 @@ export const InlineError = ({
return (
<div
className={clsx(
"text-fail text-sm flex items-center gap-1.5 selection:bg-fail selection:text-black"
"text-fail text-sm items-center gap-1.5 selection:bg-fail selection:text-black",
"break-words"
)}
>
<GoXCircle />
{errorMessage}
</div>
);
Expand Down
6 changes: 2 additions & 4 deletions apps/namadillo/src/atoms/integrations/services.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import {
DeliverTxResponse,
SigningStargateClient,
StargateClient,
assertIsDeliverTxSuccess,
} from "@cosmjs/stargate";
import { TransactionFee } from "App/Transfer/TransferModule";
import { queryForAck, queryForIbcTimeout } from "atoms/transactions";
Expand Down Expand Up @@ -134,10 +135,7 @@ export const submitIbcTransfer = async (
fee
);

if (response.code !== 0) {
throw new Error(response.code + " " + response.transactionHash);
}

assertIsDeliverTxSuccess(response);
return response;
};

Expand Down

1 comment on commit 4e26466

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.