refactor: use Error util when only throwing errors (#19837)
This commit is contained in:
parent
ef6d4a46c2
commit
c89debd19a
3 changed files with 31 additions and 28 deletions
|
@ -13,11 +13,11 @@ namespace electron {
|
|||
|
||||
namespace api {
|
||||
|
||||
void App::SetAppLogsPath(base::Optional<base::FilePath> custom_path,
|
||||
mate::Arguments* args) {
|
||||
void App::SetAppLogsPath(util::ErrorThrower thrower,
|
||||
base::Optional<base::FilePath> custom_path) {
|
||||
if (custom_path.has_value()) {
|
||||
if (!custom_path->IsAbsolute()) {
|
||||
args->ThrowError("Path must be absolute");
|
||||
thrower.ThrowError("Path must be absolute");
|
||||
return;
|
||||
}
|
||||
base::PathService::Override(DIR_APP_LOGS, custom_path.value());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue