Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[onert] Improve exception handling by subclassing std::runtime_error #16102

@arkq

Description

@arkq

Problem

Currently in the runtime core all exceptions are the same (std::runtime_error) with different message. Because of that it is not possible (without comparing message string) to distinguish these errors in the API component. Right now the API returns NNFW_STATUS_ERROR almost everywhere which makes error handling hard (the user of the API can not act differently on different errors).

Proposition

Improve error handling by creating specific errors based on the std::runtime_error. Then the list of possible errors in the API can be extended and instead of returning NNFW_STATUS_ERROR almost everywhere, dedicated error codes could be returned.

If you are OK with such change I can try to implement that.

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