segment-boneyard / nightmare

A high-level browser automation library.
https://open.segment.com
19.54k stars 1.08k forks source link

closing a nightmare if an error is found in it #1641

Closed DanLudan closed 3 years ago

DanLudan commented 3 years ago

How can I close an electron window if the catch block sees a navigation error

my code: .catch((error) => { if (error.message === "navigation error") { //close nightmare } });