Commit befb9170 authored by Nicolas Fella's avatar Nicolas Fella
Browse files

[mtp] Improve error when trying to copy from/to a nonexistant mtp device

If the device udi is not found we are currently throwing ERR_MALFORMED_URL, which is quite confusing because the URL is syntactically perfectly valid

Instead use ERR_DOES_NOT_EXIST like we do for the other functions in that case

CCBUG: 457531
parent 21b5051e
Pipeline #213878 passed with stage
in 4 minutes and 53 seconds
......@@ -528,8 +528,10 @@ void MTPSlave::copy(const QUrl &src, const QUrl &dest, int, JobFlags flags)
switch (checkUrl(dest)) {
case Url::Valid:
break;
case Url::Redirected:
case Url::NotFound:
error(ERR_DOES_NOT_EXIST, src.path());
return;
case Url::Redirected:
case Url::Invalid:
error(ERR_MALFORMED_URL, dest.path());
return;
......@@ -606,10 +608,12 @@ void MTPSlave::copy(const QUrl &src, const QUrl &dest, int, JobFlags flags)
switch (checkUrl(src)) {
case Url::Valid:
break;
case Url::Redirected:
case Url::NotFound:
error(ERR_DOES_NOT_EXIST, src.toDisplayString());
return;
case Url::Redirected:
case Url::Invalid:
error(ERR_MALFORMED_URL, src.path());
error(ERR_MALFORMED_URL, src.toDisplayString());
return;
}
......
Supports Markdown
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