Skip to content

Commit

Permalink
Add handling for another non-conforming NEAR RPC error
Browse files Browse the repository at this point in the history
  • Loading branch information
vgrichina committed Jun 18, 2024
1 parent c2ec061 commit cacdc85
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions app.js
Original file line number Diff line number Diff line change
Expand Up @@ -363,6 +363,7 @@ router.get('/(.*)', withNear, withContractId, withAccountId, async ctx => {
if (e.message.includes('CompilationError(CodeDoesNotExist')
|| e.message.includes('MethodResolveError(MethodNotFound')
|| e.message.startsWith('codeNotFound')
|| e.message.match(/Account ID .* is invalid/) // NOTE: Looks like NEAR RPC returns this for non-existent contract code
|| e.message.includes('method web4_get not found')) {

if (i == 0) {
Expand Down
2 changes: 1 addition & 1 deletion test/e2e.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ trap "pkill -SIGINT -P $$" EXIT
# Wait for server to start
sleep 1

# Use curl for basic JSON-RPC tests
# Use curl for basic tests
curl --fail-with-body http://localhost:3000/ -H 'Host: web4.near.page'
curl --fail-with-body http://localhost:3000/ -H 'Host: vlad.near.page'
curl --fail-with-body http://localhost:3000/ -H 'Host: lands.near.page'
Expand Down

0 comments on commit cacdc85

Please sign in to comment.