Skip to content

Improvement: Allow to pass arguments to error message functions #2742

Open
@keeranroth

Description

@keeranroth

For debugging purposes, it would be useful to add some context to error messages which are passed as part of thrown exceptions. For example, consider the code in function cpp/oneapi/dal/detail/common.hpp:get_data_type_size, which tries to find the size for a passed data_type. At the end of the function, the error condition is

    ...
    else if (t == data_type::float64) {
        return sizeof(double);
    }
    else {
        throw unimplemented{ dal::detail::error_messages::unsupported_data_type() };
    }

where it would be useful to have more verbose output be possible, taking information about the data type into account, e.g.

    ...
    else {
        throw unimplemented{ dal::detail::error_messages::unsupported_data_type(t) };
    }

Updating the way in which this, and similar, error messages are generated would mean that more verbose and informative messages can be reported on failures.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions