Skip to content
Snippets Groups Projects
Commit 4146842a authored by Christoph Hasse's avatar Christoph Hasse :cartwheel_tone1:
Browse files

check if file opening failed

parent 8fb4d0c2
No related branches found
No related tags found
1 merge request!2699FunctorFactory, replace CLING backend with native compiler
......@@ -165,10 +165,14 @@ struct FunctorFactory : public extends<Service, Functors::IFactory> {
} else {
auto const cpp_filename = m_jit_lib_dir + file_prefix + ".cpp";
info() << "New functor library will be created." << endmsg;
if ( msgLevel( MSG::DEBUG ) ) { debug() << "Generated C++ filename: " << cpp_filename << endmsg; }
if ( msgLevel( MSG::DEBUG ) ) { debug() << "Generating C++ file: " << cpp_filename << endmsg; }
{
std::ofstream out( cpp_filename );
std::ofstream out{cpp_filename};
if ( !out.is_open() ) {
throw GaudiException{ "Failed to open file " + cpp_filename, "FunctorFactory",
StatusCode::FAILURE };
}
out << full_lib_code;
out.close();
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment