mirror of
https://github.com/martinrotter/rssguard.git
synced 2025-01-01 02:48:05 +01:00
Better errors when guessing feed.
This commit is contained in:
parent
a96e83fb10
commit
57a67760c4
@ -30,7 +30,7 @@
|
||||
<url type="donation">https://martinrotter.github.io/donate/</url>
|
||||
<content_rating type="oars-1.1" />
|
||||
<releases>
|
||||
<release version="3.9.0" date="2021-03-16"/>
|
||||
<release version="3.9.0" date="2021-03-17"/>
|
||||
</releases>
|
||||
<content_rating type="oars-1.0">
|
||||
<content_attribute id="violence-cartoon">none</content_attribute>
|
||||
|
@ -204,6 +204,8 @@ Any errors in your script must be written to **error output**.
|
||||
|
||||
Note that you must provide full execution line to your custom script, including interpreter binary path and name and all that must be written in special format `<interpreter>#<argument1>#<argument2>#....`. The `#` character is there to separate interpreter and individual arguments. I had to select some character as separator because simply using space ` ` is not that easy as it might sound, because sometimes space could be a part of an argument sometimes argument separator etc.
|
||||
|
||||
Used script must return `0` as process exit code if everything went well, or non-zero exit code if some error happened.
|
||||
|
||||
Interpreter must be provided in all cases, arguments do not have to be. For example `bash.exe#` is valid execution line, as well as `bash#-c#cat feed.atom`. Note the difference in interpreter's binary name suffix. Also be very carefully about arguments quoting. Some examples of valid and tested execution lines are:
|
||||
|
||||
| Command | Explanation |
|
||||
|
@ -78,6 +78,7 @@ StandardFeedDetails::StandardFeedDetails(QWidget* parent) : QWidget(parent) {
|
||||
m_ui.m_txtSource->textEdit()->setFocus(Qt::FocusReason::TabFocusReason);
|
||||
|
||||
// Set feed metadata fetch label.
|
||||
m_ui.m_lblFetchMetadata->label()->setWordWrap(true);
|
||||
m_ui.m_lblFetchMetadata->setStatus(WidgetWithStatus::StatusType::Information,
|
||||
tr("No metadata fetched so far."),
|
||||
tr("No metadata fetched so far."));
|
||||
|
@ -547,7 +547,9 @@ QString StandardFeed::runScriptProcess(const QStringList& cmd_args, const QStrin
|
||||
process.closeWriteChannel();
|
||||
}
|
||||
|
||||
if (process.waitForFinished(run_timeout) && process.exitStatus() == QProcess::ExitStatus::NormalExit) {
|
||||
if (process.waitForFinished(run_timeout) &&
|
||||
process.exitStatus() == QProcess::ExitStatus::NormalExit &&
|
||||
process.exitCode() == EXIT_SUCCESS) {
|
||||
auto raw_output = process.readAllStandardOutput();
|
||||
auto raw_error = process.readAllStandardError();
|
||||
|
||||
@ -564,6 +566,10 @@ QString StandardFeed::runScriptProcess(const QStringList& cmd_args, const QStrin
|
||||
|
||||
auto raw_error = process.readAllStandardError().simplified();
|
||||
|
||||
if (raw_error.isEmpty()) {
|
||||
raw_error = process.readAllStandardOutput().simplified();
|
||||
}
|
||||
|
||||
switch (process.error()) {
|
||||
case QProcess::ProcessError::Timedout:
|
||||
throw ScriptException(ScriptException::Reason::InterpreterTimeout);
|
||||
|
Loading…
Reference in New Issue
Block a user