Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
keeranroth opened this issue Apr 24, 2024 · 0 comments
Open

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

keeranroth opened this issue Apr 24, 2024 · 0 comments

Comments

@keeranroth
Copy link
Contributor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants