Skip to content

Commit b157cd0

Browse files
committed
feat(trtllm): catch broader exception
The trycatch only uses the `what()` method, which means we can catch the broader `std::exception` instead. This is beneficial because nlohmann/json also throws exception.
1 parent 79de1c2 commit b157cd0

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

backends/trtllm/csrc/ffi.hpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#ifndef TGI_BACKEND_TRTLLM_FFI
22
#define TGI_BACKEND_TRTLLM_FFI
33

4+
#include <exception>
45
#include <memory>
56
#include <thread>
67

@@ -17,7 +18,7 @@ namespace rust::behavior {
1718
template<typename Try, typename Fail>
1819
static void trycatch(Try &&func, Fail &&fail) noexcept try {
1920
func();
20-
} catch (tensorrt_llm::common::TllmException &e) {
21+
} catch (const std::exception &e) {
2122
fail(e.what());
2223
}
2324
}

0 commit comments

Comments
 (0)