Skip to content

Commit

Permalink
rev: otbSQLiteProcessor: sqlExec: report error or warning depending
Browse files Browse the repository at this point in the history
     on error code/type
  • Loading branch information
heralex committed Jul 12, 2018
1 parent 7614fb5 commit c2c8de8
Showing 1 changed file with 21 additions and 6 deletions.
27 changes: 21 additions & 6 deletions otbsuppl/filters/otbSQLiteProcessor.txx
Original file line number Diff line number Diff line change
Expand Up @@ -191,12 +191,27 @@ void SQLiteProcessor< TInputImage, TOutputImage >
this->UpdateProgress(0.2);
if (!m_vRAT.at(0)->SqlExec(m_SQLStatement))
{
// we just give a warning here, since we might do things
// like adding a column; and if the column is already
// present, the overall modelling run is not interrupted
NMProcWarn(<< "SQL processing failed - "
<< m_vRAT.at(0)->getLastLogMsg());
//return;
// we only report an error for the following
// conditions:
// - database is locked
//
// all other conditions are treated as OK; for instance
// we just give a warning if try to a add a column that
// is already present and in general doesn't affect the
// overall modelling run


std::string lastlog = m_vRAT.at(0)->getLastLogMsg();
if (lastlog.find("database is locked") != std::string::npos)
{
NMProcErr(<< "SQL processing failed - "
<< lastlog);
}
else
{
NMProcWarn(<< "SQL processing failed - "
<< lastlog);
}
}

for (int i=1; i < m_vRAT.size(); ++i)
Expand Down

0 comments on commit c2c8de8

Please sign in to comment.