blueslip: Replace fatal with throw new Error(…).

This makes it clear to humans and ESLint that execution will not
continue.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
Anders Kaseorg
2020-09-23 22:56:29 -07:00
committed by Tim Abbott
parent 93a0680881
commit fe66aef0ad
7 changed files with 13 additions and 18 deletions

View File

@@ -761,8 +761,8 @@ exports.create_streams = function (streams) {
exports.create_sub_from_server_data = function (attrs) {
if (!attrs.stream_id) {
// fail fast (blueslip.fatal will throw an error on our behalf)
blueslip.fatal("We cannot create a sub without a stream_id");
// fail fast
throw new Error("We cannot create a sub without a stream_id");
}
let sub = exports.get_sub_by_id(attrs.stream_id);