| 1435 | } |
| 1436 | |
| 1437 | void SendError(TResponseError err, const THttpErrorDetails& details) override { |
| 1438 | static const unsigned errorToHttpCode[IRequest::MaxResponseError] = |
| 1439 | { |
| 1440 | 400, |
| 1441 | 403, |
| 1442 | 404, |
| 1443 | 429, |
| 1444 | 500, |
| 1445 | 501, |
| 1446 | 502, |
| 1447 | 503, |
| 1448 | 509}; |
| 1449 | |
| 1450 | if (!!C_) { |
| 1451 | C_->SendError(Id(), errorToHttpCode[err], details.Details, P_->HttpVersion(), details.Headers); |
| 1452 | C_.Reset(); |
| 1453 | } |
| 1454 | } |
| 1455 | |
| 1456 | static TAtomicBase NextId() { |
| 1457 | static TAtomic idGenerator = 0; |