feat: add sink fail reason and correctly propagate it through the NetRequest
Signed-off-by: Trial97 <alexandru.tripon97@gmail.com>
This commit is contained in:
@@ -58,6 +58,7 @@ class ByteArraySink : public Sink {
|
||||
qWarning() << "ByteArraySink did not initialize the buffer because it's not addressable";
|
||||
if (initAllValidators(request))
|
||||
return Task::State::Running;
|
||||
m_fail_reason = "Failed to initialize validators";
|
||||
return Task::State::Failed;
|
||||
};
|
||||
|
||||
@@ -69,12 +70,14 @@ class ByteArraySink : public Sink {
|
||||
qWarning() << "ByteArraySink did not write the buffer because it's not addressable";
|
||||
if (writeAllValidators(data))
|
||||
return Task::State::Running;
|
||||
m_fail_reason = "Failed to write validators";
|
||||
return Task::State::Failed;
|
||||
}
|
||||
|
||||
auto abort() -> Task::State override
|
||||
{
|
||||
failAllValidators();
|
||||
m_fail_reason = "Aborted";
|
||||
return Task::State::Failed;
|
||||
}
|
||||
|
||||
@@ -82,12 +85,13 @@ class ByteArraySink : public Sink {
|
||||
{
|
||||
if (finalizeAllValidators(reply))
|
||||
return Task::State::Succeeded;
|
||||
m_fail_reason = "Failed to finalize validators";
|
||||
return Task::State::Failed;
|
||||
}
|
||||
|
||||
auto hasLocalData() -> bool override { return false; }
|
||||
|
||||
private:
|
||||
protected:
|
||||
std::shared_ptr<QByteArray> m_output;
|
||||
};
|
||||
} // namespace Net
|
||||
|
||||
Reference in New Issue
Block a user