Skip to content

Better RUNTIME_CHECK and RUNTIME_ASSERT #5444

@fuzhe1989

Description

@fuzhe1989

Enhancement

RUNTIME_CHECK

Current RUNTIME_CHECK usage is:

RUNTIME_CHECK(a != b, ExceptionType, "{} != {}", a, b);

It's not clear for users to know which exception will be thrown. A better way is to explicit write code for generating an exception object like:

RUNTIME_CHECK(a != b, ExceptionType("{} != {}", a, b));

And the new style could enable better compilation checks.

RUNTIME_ASSERT

Current RUNTIME_ASSERT always needs a logger and make it hard for replacing existent asserts. We should let it work without user provided logger (in which case a default logger is used).

Metadata

Metadata

Assignees

No one assigned

    Labels

    type/enhancementThe issue or PR belongs to an enhancement.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions