I've been using Browsersync via the API, and I was struggling for ages to figure out why my app kept crashing on me without any warning shortly after I ran bs.init(). I managed to narrow it down to lib/utils.js#L186, and then realized I had been trying to initialize my browsersync instance with invalid configuration, and browsersync was responding by killing the whole process.
Is the process.exit(1) intentional here? I can understand this makes sense if you're running it directly from the command line, but when you're running it via the API there's already an error callback that is fired when it encounters an error, so surely it should be up to the callback to handle the error gracefully?
I've been using Browsersync via the API, and I was struggling for ages to figure out why my app kept crashing on me without any warning shortly after I ran
bs.init()
. I managed to narrow it down to lib/utils.js#L186, and then realized I had been trying to initialize my browsersync instance with invalid configuration, and browsersync was responding by killing the whole process.Is the
process.exit(1)
intentional here? I can understand this makes sense if you're running it directly from the command line, but when you're running it via the API there's already an error callback that is fired when it encounters an error, so surely it should be up to the callback to handle the error gracefully?