bool response_promise_catch_handler(JSContext *cx, HandleObject event, HandleValue promise_val,
                                    CallArgs args) {
  RootedObject promise(cx, &promise_val.toObject());

  fprintf(stderr, "Error while running request handler: ");
  dump_promise_rejection(cx, args.get(0), promise, stderr);

  // TODO: verify that this is the right behavior.
  // Steps 9.1-2
  return respondWithError(cx, event);
}
bool response_promise_catch_handler(JSContext *cx, HandleObject event, HandleValue promise_val,
                                    CallArgs args) {
  RootedObject promise(cx, &promise_val.toObject());

  fprintf(stderr, "Error while running request handler: ");
  dump_promise_rejection(cx, args.get(0), promise, stderr);

   
   
  return respondWithError(cx, event);
}