Skip to content

Clever errors update #204

@0xangelo

Description

@0xangelo

Hello Mysten,

I noticed this #[error(code = ...)] syntax in some framework modules. Example:

/// Tries to create an object twice with the same parent-key combination.
#[error(code = 0)]
const EObjectAlreadyExists: vector<u8> = b"Derived object is already claimed.";

The clever errors I was used to didn't have any parameters, and indeed the move-book makes no mention of them.

Another source tells me that they've been changed as follows

The error bitset changed from this to this:

| tag (1-bit) | reserved (7-bits) | code (8-bits) | line_number (16-bits) | identifier_index (16-bits) | constant_index (16-bits) |

Would you like help editing the Clever Errors reference?

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