Skip to content
This repository has been archived by the owner on Sep 16, 2024. It is now read-only.

Commit

Permalink
fix: add TX_INVALID to list of possible warp errors
Browse files Browse the repository at this point in the history
  • Loading branch information
dtfiedler committed Sep 20, 2023
1 parent 0186f86 commit 7cf2505
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/api/warp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,6 @@ export async function getContractState({
new ContractStateCacheKey(contractTxId, evaluationOptions, warp, logger),
);
} catch (error) {
console.log(error);
// throw an eval here so we can properly return correct status code
if (
error instanceof Error &&
Expand All @@ -186,8 +185,8 @@ export async function getContractState({
) {
throw new EvaluationError(error.message);
} else if (
(error as any).type &&
(error as any).type.includes('TX_NOT_FOUND')
((error as any).type && (error as any).type.includes('TX_NOT_FOUND')) ||

Check warning on line 188 in src/api/warp.ts

View workflow job for this annotation

GitHub Actions / build (lint:check)

Unexpected any. Specify a different type

Check warning on line 188 in src/api/warp.ts

View workflow job for this annotation

GitHub Actions / build (lint:check)

Unexpected any. Specify a different type
(error as any).includes('TX_INVALID')

Check warning on line 189 in src/api/warp.ts

View workflow job for this annotation

GitHub Actions / build (lint:check)

Unexpected any. Specify a different type
) {
throw new NotFoundError('Contract not found');
} else if (error instanceof Error && error.message.includes('404')) {
Expand Down

0 comments on commit 7cf2505

Please sign in to comment.