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

Convenience method for error processing #134

Open
kurapov-peter opened this issue Feb 13, 2024 · 0 comments
Open

Convenience method for error processing #134

kurapov-peter opened this issue Feb 13, 2024 · 0 comments

Comments

@kurapov-peter
Copy link

kurapov-peter commented Feb 13, 2024

Hi!

More often than not, error handling by the returned value takes the form of some macro checks that emit an exception or similar. E.g.,

#define L0_SAFE_CALL(call)                     \
  {                                            \
    auto status = (call);                      \
    if (status) {                              \
      throw some_exception(to_string(status)); \
    }                                          \
  }

To create a meaningful message it would be convenient to have a method in the loader that would take a single parameter - an error code - and return a string with the failure name. Even exposing the already-existing to_string function (https://github.com/oneapi-src/level-zero/blob/master/source/loader/ze_loader.cpp#L23) would be nice. This will make consumers not replicate it and avoid potential mismatches in case of any changes in the future.

Jemale pushed a commit to Jemale/level-zero that referenced this issue Jun 17, 2024
Signed-off-by: davidoli <david.olien@intel.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant