Skip to content

Commit

Permalink
include configuration filename in fail-to-load exception
Browse files Browse the repository at this point in the history
  • Loading branch information
maloel committed Jan 1, 2024
1 parent ca972dc commit ce93e02
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/context.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ namespace librealsense {
nlohmann::json config;

// Load the realsense configuration file settings
std::ifstream f( rsutils::os::get_special_folder( rsutils::os::special_folder::app_data ) + RS2_CONFIG_FILENAME );
auto const filename = rsutils::os::get_special_folder( rsutils::os::special_folder::app_data ) + RS2_CONFIG_FILENAME;
std::ifstream f( filename );
if( f.good() )
{
try
Expand All @@ -45,7 +46,7 @@ namespace librealsense {
}
catch( std::exception const & e )
{
throw std::runtime_error( "failed to load configuration file: " + std::string( e.what() ) );
throw std::runtime_error( "failed to load configuration file (" + filename + "): " + std::string( e.what() ) );
}
}

Expand Down

0 comments on commit ce93e02

Please sign in to comment.