fix: improve ses.cookies.set error message when url is missing (#26268)

This commit is contained in:
Jeremy Rose 2020-11-02 02:00:29 -08:00 committed by GitHub
parent ecd23bb29b
commit 123e8d7038
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -291,6 +291,9 @@ v8::Local<v8::Promise> Cookies::Set(v8::Isolate* isolate,
v8::Local<v8::Promise> handle = promise.GetHandle();
const std::string* url_string = details.FindStringKey("url");
if (!url_string) {
promise.RejectWithErrorMessage("Missing required option 'url'");
}
const std::string* name = details.FindStringKey("name");
const std::string* value = details.FindStringKey("value");
const std::string* domain = details.FindStringKey("domain");