Let the runner report a failed save

The runner needs the original save error to report a failure.

your task

On failure, let the runner receive the error. Print nothing from checkSave on that path. On success, print “check: ” followed by the result, then “pass”.

A save with an empty room name fails. The starter prints “save failed, continuing” and then “pass”. The runner already knows how to report a save error.

Starter code
or press Ctrl EnterNot run yet

cases

Not run yetA booking for Atlas

Expected output

1check: saved Atlas
2pass
See the input and the code for this case
function saveBooking(room) {
  if (room === "") return Promise.reject(new Error("A room is required"));
  return Promise.resolve("saved " + room);
}
try {
  await checkSave("Atlas");
} catch (error) {
  console.log("fail: " + error.message);
}
Not run yetAn empty room name

Expected output

1fail: A room is required
See the input and the code for this case
function saveBooking(room) {
  if (room === "") return Promise.reject(new Error("A room is required"));
  return Promise.resolve("saved " + room);
}
try {
  await checkSave("");
} catch (error) {
  console.log("fail: " + error.message);
}