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

Adaptive(?) Error Messages #35

Open
wgledbetter opened this issue Jun 1, 2023 · 2 comments
Open

Adaptive(?) Error Messages #35

wgledbetter opened this issue Jun 1, 2023 · 2 comments
Assignees

Comments

@wgledbetter
Copy link
Contributor

Any time an error is thrown as a result of evaluating a conditional, the arguments to the conditional should be embedded in the error message.

@wgledbetter wgledbetter self-assigned this Jun 1, 2023
@wgledbe
Copy link

wgledbe commented Jun 1, 2023

For example,

if (xv != ORows()){
    throw std::invalid_argument("size bad pls fix");
}

vs.

if (xv != ORows()){
    std::string errStr = fmt::format("Dear Sir (or Madam),\n\tI regret to inform you that your GenericODE has internal size inconsistencies. You have told me that the ODE has {} X variables, but the output size of compute is {}. I wish you luck in correcting these issues posthaste.\nRegards,\nA.S.S.E.T.\n\nP.S. You may wish to begin your endeavor in '{}' on line {}.", xv, ORows(), __FILE__, __LINE__);
    someLog.error(errStr);
    throw std::invalid_argument(errStr);
}

@jbpezent
Copy link
Contributor

jbpezent commented Jun 7, 2023

@wgledbetter Agreed, line numbers are already handled when the exception is thrown to python, but there is alot more information that we could and should provide in the error messages, regarding IO sizes, to help diagnose issues.

@jbpezent jbpezent self-assigned this Jun 7, 2023
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

3 participants