diff --git a/src/simulation/ngspice_simulator.cpp b/src/simulation/ngspice_simulator.cpp index d81671bc1..b041ac0ca 100644 --- a/src/simulation/ngspice_simulator.cpp +++ b/src/simulation/ngspice_simulator.cpp @@ -82,6 +82,7 @@ void NgSpiceSimulator::init() { m_library.setFileName(library.canonicalFilePath()); m_library.load(); if( m_library.isLoaded() ) { + DebugDialog::debug("Ngspice loaded from " + path); break; } else { DebugDialog::debug("Couldn't load ngspice " + m_library.errorString()); @@ -91,6 +92,11 @@ void NgSpiceSimulator::init() { } } + if( !m_library.isLoaded() ) { + DebugDialog::debug("Couldn't load ngspice " + m_library.errorString()); + throw std::runtime_error( "Error loading ngspice shared library: " + m_library.errorString().toStdString() ); + } + setErrorTitle(std::nullopt); std::vector symbols{STRFY(ngSpice_Command), STRFY(ngSpice_Init), STRFY(ngSpice_Circ), STRFY(ngGet_Vec_Info)}; diff --git a/src/simulation/simulator.cpp b/src/simulation/simulator.cpp index b434b2dc1..e3b5cfb79 100644 --- a/src/simulation/simulator.cpp +++ b/src/simulation/simulator.cpp @@ -210,7 +210,7 @@ void Simulator::simulate() { m_simulator->init(); } catch (std::exception& e) { - FMessageBox::warning(nullptr, tr("Simulator Error"), tr("An error occurred when starting the simulation.")); + FMessageBox::warning(nullptr, tr("Simulator Error"), tr("An error occurred when starting the simulation:\n%1").arg(e.what())); stopSimulation(); return; }