Skip to content

try/catch for abi.decode() or abi.tryDecode #10381

Open
@gitpusha

Description

@gitpusha

Hi,

I am referencing the conversation #10317 .

It would be nice to have a way to catch errors thrown during abi.decode operations.

Quoting @chriseth:

Instead of try/catch we should maybe rather have abi.tryDecode? The problem here is how to return the data in the two cases

Also try catch might be useful for functions other than abi.decode but I will first need to find concrete examples and will report them here in this issue.


Preliminary implementation: #10883

Metadata

Metadata

Assignees

No one assigned

    Labels

    high effortA lot to implement but still doable by a single person. The task is large or difficult.high impactChanges are very prominent and affect users or the project in a major way.language design :rage4:Any changes to the language, e.g. new featuresmust haveSomething we consider an essential part of Solidity 1.0.needs designThe proposal is too vague to be implemented right away

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions