Skip to content

Incorrect error handling in accessControl function #28

Description

@imajus

Here, the errors may be silently lost.

In my case I have the following data value:

[
  {
    isSuccess: false,
    error: {
      data: {
      },
      message: {
        message: "conditions[0].chain must be one of [Ethereum, Rinkeby, Polygon, Fantom, FantomTest, AVAX, Fuji, BSC, BSCTest, Optimism, OptimismGoerli, OptimismKovan, Mumbai, Filecoin, Wallaby, Filecoin_Testnet, shardeum, Shardeum_Lib1, Shardeum_Lib2, Shardeum_Sphinx, Goerli, Hyperspace, BTTC, BTTC_Testnet, Sepolia_PGN, Arbitrum_Sepolia, Sepolia, Base, Base_Testnet, Lukso, Lukso_Testnet, Amoy_Testnet, Abstract_Testnet]",
        param: "chain",
      },
      statusCode: 400,
    },
  },
  // +4 same objects
]

The function then returns only this:

{ isSuccess: false, error: null }

This essentially conceals the cause of the error from the caller, which degrades the debugging experience.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions