chore: add error throwing utility (#19803)

* chore: add error throwing utility

* feedback from review

* DRY out repeated isolate calls
This commit is contained in:
Shelley Vohr 2019-08-19 09:10:18 -07:00 committed by GitHub
parent 8f1c51eaea
commit 43e6d7fe88
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 118 additions and 4 deletions

View file

@ -405,8 +405,8 @@ std::string SystemPreferences::GetAccentColor() {
return base::SysNSStringToUTF8([sysColor RGBAValue]);
}
std::string SystemPreferences::GetSystemColor(const std::string& color,
mate::Arguments* args) {
std::string SystemPreferences::GetSystemColor(util::ErrorThrower thrower,
const std::string& color) {
NSColor* sysColor = nil;
if (color == "blue") {
sysColor = [NSColor systemBlueColor];
@ -427,7 +427,7 @@ std::string SystemPreferences::GetSystemColor(const std::string& color,
} else if (color == "yellow") {
sysColor = [NSColor systemYellowColor];
} else {
args->ThrowError("Unknown system color: " + color);
thrower.ThrowError("Unknown system color: " + color);
return "";
}