refactor: use Error util when only throwing errors (#19837)

This commit is contained in:
Shelley Vohr 2019-08-23 15:49:54 -07:00 committed by Samuel Attard
parent ef6d4a46c2
commit c89debd19a
3 changed files with 31 additions and 28 deletions

View file

@ -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());