fix: throw better error on getPath('logs') (#19514)
This commit is contained in:
parent
e74daf2d19
commit
69646f4258
2 changed files with 10 additions and 3 deletions
|
@ -871,8 +871,15 @@ base::FilePath App::GetPath(mate::Arguments* args, const std::string& name) {
|
|||
int key = GetPathConstant(name);
|
||||
if (key >= 0)
|
||||
succeed = base::PathService::Get(key, &path);
|
||||
if (!succeed)
|
||||
args->ThrowError("Failed to get '" + name + "' path");
|
||||
if (!succeed) {
|
||||
if (name == "logs") {
|
||||
args->ThrowError("Failed to get '" + name +
|
||||
"' path: setAppLogsPath() must be called first.");
|
||||
} else {
|
||||
args->ThrowError("Failed to get '" + name + "' path");
|
||||
}
|
||||
}
|
||||
|
||||
return path;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue