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

Extensions got broken with #1226 #1229

Closed
tmadlener opened this issue Feb 14, 2024 · 7 comments · Fixed by #1230
Closed

Extensions got broken with #1226 #1229

tmadlener opened this issue Feb 14, 2024 · 7 comments · Fixed by #1230
Assignees
Labels

Comments

@tmadlener
Copy link
Contributor

tmadlener commented Feb 14, 2024

Originally reported in key4hep/k4geo#319

For ILD there is a *long list of the following:

[...]
ObjectExtensions::extension ERROR The object has no extension of type FB10DC132C7B13D5.
ObjectExtensions::extension ERROR The object has no extension of type FB10DC132C7B13D5.
ObjectExtensions::extension ERROR The object has no extension of type FB10DC132C7B13D5.
[...]

I have tested locally and this appeared after #1226 but was not present before. Things seem to still be running, but I am not yet sure whether the results make sense or whether it's only not crashing.

@tmadlener tmadlener added the bug label Feb 14, 2024
@andresailer andresailer self-assigned this Feb 14, 2024
@andresailer
Copy link
Member

andresailer commented Feb 14, 2024

@andresailer
Copy link
Member

andresailer commented Feb 14, 2024

I think we need to restore the silent throwing of exceptions

@andresailer
Copy link
Member

This kind of code depends on the exception

try {
_sL = det.extension< SurfaceList >() ;
} catch(const std::exception& e) {
_sL = det.addExtension<SurfaceList >( new SurfaceList( true ) ) ;
}

And it would be very annoying to get that printout?

@andresailer
Copy link
Member

@tmadlener Can you try with #1230 ?

@MarkusFrankATcernch
Copy link
Contributor

I cannot see a functional difference in the code fragments of the change you pointed out above.

-- "except" internally throws an exeption (std::runtime_error).
-- The "return nullptr" is only there to please the compiler....

Yes you can suppress the exception, but why should this be suddenly be necessary?

@andresailer
Copy link
Member

The difference is that except prints, throw before didn't print. Adding alert=false silences the printout, and then one has to nullptr check instead of catch.

@MarkusFrankATcernch
Copy link
Contributor

This is absolutely true.
Is this test only failing because the string "ERROR" is in the output, but properly running otherwise?
Then your argument is very valid.

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

Successfully merging a pull request may close this issue.

3 participants