Commit 1d845be1 authored by Aleix Pol Gonzalez's avatar Aleix Pol Gonzalez 🐧

Finish streams when the stream ends with an error

parent fa4f70e9
......@@ -98,6 +98,7 @@ ResultsStream * SnapBackend::populate(QSnapdListOneRequest* job, AbstractResourc
connect(job, &QSnapdFindRequest::complete, stream, [stream, this, state, job]() {
if (job->error()) {
qDebug() << "error:" << job->error() << job->errorString();
stream->finish();
return;
}
QSet<SnapResource*> higher = kFilter<QSet<SnapResource*>>(m_resources, [state](AbstractResource* res){ return res->state()>=state; });
......@@ -136,6 +137,7 @@ ResultsStream* SnapBackend::populate(T* job, AbstractResource::State state)
connect(job, &QSnapdFindRequest::complete, stream, [stream, this, state, job]() {
if (job->error()) {
qDebug() << "error:" << job->error() << job->errorString();
stream->finish();
return;
}
QSet<SnapResource*> higher = kFilter<QSet<SnapResource*>>(m_resources, [state](AbstractResource* res){ return res->state()>=state; });
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment