{std::string("/v1/" #api_name "/" #call_name), \
[&api_handle](string, string body, url_response_callback cb) mutable { \
if (body.empty()) body = "{}"; \
auto next = [cb, body](const std::variant<fc::exception_ptr, call_result>& result){\
if (std::holds_alternative<fc::exception_ptr>(result)) {\
try {\
std::get<fc::exception_ptr>(result)->dynamic_rethrow_exception();\
} catch (...) {\
http_plugin::handle_exception(#api_name, #call_name, body, cb);\
}\
} else {\
cb(http_response_code, std::visit(async_result_visitor(), result));\
}\
};\
INVOKE\
}\
}
41#define CALL_ASYNC(api_name, api_handle, call_name, call_result, INVOKE, http_response_code) \
42{std::string("/v1/" #api_name "/" #call_name), \
43 [&api_handle](string, string body, url_response_callback cb) mutable { \
44 if (body.empty()) body = "{}"; \
45 auto next = [cb, body](const std::variant<fc::exception_ptr, call_result>& result){\
46 if (std::holds_alternative<fc::exception_ptr>(result)) {\
47 try {\
48 std::get<fc::exception_ptr>(result)->dynamic_rethrow_exception();\
49 } catch (...) {\
50 http_plugin::handle_exception(#api_name, #call_name, body, cb);\
51 }\
52 } else {\
53 cb(http_response_code, std::visit(async_result_visitor(), result));\
54 }\
55 };\
56 INVOKE\
57 }\
58}