Skip to content

Commit c2c8de8

Browse files
committed
rev: otbSQLiteProcessor: sqlExec: report error or warning depending
on error code/type
1 parent 7614fb5 commit c2c8de8

File tree

1 file changed

+21
-6
lines changed

1 file changed

+21
-6
lines changed

otbsuppl/filters/otbSQLiteProcessor.txx

Lines changed: 21 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -191,12 +191,27 @@ void SQLiteProcessor< TInputImage, TOutputImage >
191191
this->UpdateProgress(0.2);
192192
if (!m_vRAT.at(0)->SqlExec(m_SQLStatement))
193193
{
194-
// we just give a warning here, since we might do things
195-
// like adding a column; and if the column is already
196-
// present, the overall modelling run is not interrupted
197-
NMProcWarn(<< "SQL processing failed - "
198-
<< m_vRAT.at(0)->getLastLogMsg());
199-
//return;
194+
// we only report an error for the following
195+
// conditions:
196+
// - database is locked
197+
//
198+
// all other conditions are treated as OK; for instance
199+
// we just give a warning if try to a add a column that
200+
// is already present and in general doesn't affect the
201+
// overall modelling run
202+
203+
204+
std::string lastlog = m_vRAT.at(0)->getLastLogMsg();
205+
if (lastlog.find("database is locked") != std::string::npos)
206+
{
207+
NMProcErr(<< "SQL processing failed - "
208+
<< lastlog);
209+
}
210+
else
211+
{
212+
NMProcWarn(<< "SQL processing failed - "
213+
<< lastlog);
214+
}
200215
}
201216

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

0 commit comments

Comments
 (0)