mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Fault reactivation export: improve error handling.
This commit is contained in:
@@ -27,6 +27,7 @@
|
||||
|
||||
#include <QAction>
|
||||
#include <QFile>
|
||||
#include <QMessageBox>
|
||||
#include <QString>
|
||||
|
||||
CAF_CMD_SOURCE_INIT( RicExportInpFileFeature, "RicExportInpFileFeature" );
|
||||
@@ -47,8 +48,16 @@ void RicExportInpFileFeature::onActionTriggered( bool isChecked )
|
||||
auto faultReactivationModel = caf::SelectionManager::instance()->selectedItemOfType<RimFaultReactivationModel>();
|
||||
if ( faultReactivationModel )
|
||||
{
|
||||
QString exportFile = faultReactivationModel->baseDir() + "/faultreactivation.inp";
|
||||
RifFaultReactivationModelExporter::exportToFile( exportFile.toStdString(), *faultReactivationModel );
|
||||
QString exportFile = faultReactivationModel->baseDir() + "/faultreactivation.inp";
|
||||
auto [isOk, errorMessage] = RifFaultReactivationModelExporter::exportToFile( exportFile.toStdString(), *faultReactivationModel );
|
||||
if ( !isOk )
|
||||
{
|
||||
const QString frmTitle( "Fault Reactivation Modeling" );
|
||||
|
||||
QString outErrorText =
|
||||
QString( "Failed to export INP model to file %1.\n\n%2" ).arg( exportFile ).arg( QString::fromStdString( errorMessage ) );
|
||||
QMessageBox::critical( nullptr, frmTitle, outErrorText );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user