Skip to content

Commit

Permalink
Fix to catch all parser exception and report error (triton-inference-…
Browse files Browse the repository at this point in the history
  • Loading branch information
GuanLuo authored Mar 21, 2023
1 parent 980bd76 commit 4f25388
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions src/main.cc
Original file line number Diff line number Diff line change
Expand Up @@ -420,15 +420,25 @@ main(int argc, char** argv)
try {
auto res = tp.Parse(argc, argv);
g_triton_params = res.first;
g_triton_params.CheckPortCollision();
}
catch (const triton::server::ParseException& pe) {
std::cerr << pe.what() << std::endl;
std::cerr << "Usage: tritonserver [options]" << std::endl;
std::cerr << tp.Usage() << std::endl;
exit(1);
}
g_triton_params.CheckPortCollision();
auto triton_options = g_triton_params.BuildTritonServerOptions();

triton::server::TritonServerParameters::ManagedTritonServerOptionPtr
triton_options(nullptr, TRITONSERVER_ServerOptionsDelete);
try {
triton_options = g_triton_params.BuildTritonServerOptions();
}
catch (const triton::server::ParseException& pe) {
std::cerr << "Failed to build Triton option:" << std::endl;
std::cerr << pe.what() << std::endl;
exit(1);
}

#ifdef TRITON_ENABLE_LOGGING
// Initialize our own logging instance since it is used by GRPC and
Expand Down

0 comments on commit 4f25388

Please sign in to comment.