void StreamSubscriptionResponderBase::onErrorImpl( folly::exception_wrapper ex) noexcept { debugCheckOnNextOnCompleteOnError(); switch (state_) { case State::RESPONDING: { state_ = State::CLOSED; applicationError(ex.what().toStdString()); } break; case State::CLOSED: break; } }
void RocketServerStreamSubscriber::onError(folly::exception_wrapper ew) { if (!context_) { return; } if (!ew.with_exception<RocketException>([this](auto&& rex) { context_->sendError( RocketException(ErrorCode::APPLICATION_ERROR, rex.moveErrorData())); })) { context_->sendError( RocketException(ErrorCode::APPLICATION_ERROR, ew.what())); } context_->freeStream(); }
void FrameTransport::terminateFrameProcessor(folly::exception_wrapper ex) { // this method can be executed multiple times during terminating std::shared_ptr<FrameProcessor> frameProcessor; { std::lock_guard<std::recursive_mutex> lock(mutex_); frameProcessor = std::move(frameProcessor_); } if (frameProcessor) { VLOG(3) << this << " terminating frame processor ex=" << ex.what(); frameProcessor->onTerminal(std::move(ex)); } }
void FrameTransport::onError(folly::exception_wrapper ex) noexcept { VLOG(6) << "onError" << ex.what(); terminateFrameProcessor(std::move(ex)); }