| 1222 | std::tie(argc, argv) = winArgs.get(); |
| 1223 | #else |
| 1224 | int main(int argc, char* argv[]) |
| 1225 | { |
| 1226 | #endif |
| 1227 | SetupEnvironment(); |
| 1228 | if (!SetupNetworking()) { |
| 1229 | tfm::format(std::cerr, "Error: Initializing networking failed\n"); |
| 1230 | return EXIT_FAILURE; |
| 1231 | } |
| 1232 | event_set_log_callback(&libevent_log_cb); |
| 1233 | |
| 1234 | try { |
| 1235 | int ret = AppInitRPC(argc, argv); |
| 1236 | if (ret != CONTINUE_EXECUTION) |
| 1237 | return ret; |
| 1238 | } |
| 1239 | catch (const std::exception& e) { |
| 1240 | PrintExceptionContinue(&e, "AppInitRPC()"); |
| 1241 | return EXIT_FAILURE; |
| 1242 | } catch (...) { |
| 1243 | PrintExceptionContinue(nullptr, "AppInitRPC()"); |
| 1244 | return EXIT_FAILURE; |
| 1245 | } |
| 1246 | |
| 1247 | int ret = EXIT_FAILURE; |
| 1248 | try { |
| 1249 | ret = CommandLineRPC(argc, argv); |
| 1250 | } |
| 1251 | catch (const std::exception& e) { |
| 1252 | PrintExceptionContinue(&e, "CommandLineRPC()"); |
| 1253 | } catch (...) { |
| 1254 | PrintExceptionContinue(nullptr, "CommandLineRPC()"); |
| 1255 | } |
| 1256 | return ret; |
| 1257 | } |
nothing calls this directly
no test coverage detected