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

Catch missed errors during instance initiation #665

Merged
merged 17 commits into from
Oct 24, 2023

Conversation

jesper-friis
Copy link
Collaborator

@jesper-friis jesper-friis commented Oct 11, 2023

Description

Trying to catch missed errors in dlite.Instance.init()

C-level errors are bypassed by SWIG when calling dlite.new_Instance() and dlite.Instance_swiginit() since they are internal and not generated functions.

Try to see if we can create normal error-catching wrappers around these functions.

Type of change

  • Bug fix & code cleanup
  • New feature
  • Documentation update
  • Test update

Checklist for the reviewer

This checklist should be used as a help for the reviewer.

  • Is the change limited to one issue?
  • Does this PR close the issue?
  • Is the code easy to read and understand?
  • Do all new feature have an accompanying new test?
  • Has the documentation been updated as necessary?

C-level errors are bypassed by SWIG when calling `dlite.new_Instance()` and
`dlite.Instance_swiginit()` since they are internal and not generated
functions.

Try to see if we can create normal error-catching wrappers around these
functions.
@jesper-friis jesper-friis marked this pull request as draft October 11, 2023 08:10
@jesper-friis jesper-friis changed the title Catch missed errors during instance initiatiation WIP: Catch missed errors during instance initiatiation Oct 11, 2023
@jesper-friis jesper-friis changed the title WIP: Catch missed errors during instance initiatiation WIP: Catch missed errors during instance initiation Oct 11, 2023
@jesper-friis jesper-friis changed the title WIP: Catch missed errors during instance initiation Catch missed errors during instance initiation Oct 16, 2023
Copy link
Collaborator

@francescalb francescalb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved under the condition that you create and issue about documenting this so that the code is selfdocumenting. Make sure to link to this PR.

@francescalb francescalb marked this pull request as ready for review October 17, 2023 10:49
@jesper-friis
Copy link
Collaborator Author

Approved under the condition that you create and issue about documenting this so that the code is selfdocumenting. Make sure to link to this PR.

Comment added to the code clarifying the purpose of this PR.

@jesper-friis jesper-friis merged commit 2b7c073 into master Oct 24, 2023
11 checks passed
@jesper-friis jesper-friis deleted the errors-in-instance_init branch October 24, 2023 18:34
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

Successfully merging this pull request may close these issues.

2 participants