nlohmann/exception_reporter được TopGit xếp vào nhóm dự án mã nguồn mở, với 27 sao trên GitHub, viết chủ yếu bằng Python. A tool to collect the exceptions that can reach a C++ function
Tóm tắt dựng từ metadata GitHub của chính dự án — chưa có bài review TopGit. Trang sẽ tự động cập nhật khi bài review đầy đủ được xuất bản.
VÌ SAO CHƯA CÓ REVIEW
TopGit viết bài đầy đủ cho repo có nhiều sao nhất và được yêu cầu nhiều nhất. Trang này là snapshot trong thời gian chờ — xem README gốc ở tab READ ME.
This tool tries to answer this r/cpp question for a tool to find out, for a given function in my code base, which exceptions it may encounter. It is a simple Python script processing a callgraph generated by Clang. It is far from being ready or useful, but demonstrates that this approach could be feasible.
Please open an issue for ideas or bugs.
Example
Assume the following C++ program:
#include <map>
using int_map = std::map<int, int>;
int bar(int i, const int_map& m)
{
if (i == 100)
{
throw std::runtime_error("oops");
}
try
{
return m.at(i);
}
catch (std::out_of_range&)
{
return -1;
}
}
int main()
{
int_map m;
m[1] = 1;
if (bar(2, m) == -1)
{
return 1;
}
}
The goal is to find out which exceptions can be encountered in its functions; that is, which try/catch block needs to be written.
# step 1: create a callgraph with clang and demangle its C++ symbols
clang++ -S -emit-llvm examples/example.cpp -o - | opt -print-callgraph 2>&1 | sed "s/'/\"/g" | c++filt -n > callgraph.txt
# step 2: analyze the callgraph
./exeption_reporter.py callgraph.txt
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Trang TopGit này là một snapshot — tab "Readme" hiển thị nguyên văn README của repo (đã bỏ link, giữ ảnh). Repo GitHub ở github.com/nlohmann/exception_reporter là nguồn chính thức.
nlohmann/exception_reporter có bao nhiêu sao?
nlohmann/exception_reporter có 27 sao GitHub — tải lại trang để xem số mới nhất, hoặc xem trực tiếp github.com/nlohmann/exception_reporter. TopGit phản chiếu số sao của GitHub nhưng không cam kết đến từng phút.
nlohmann/exception_reporter có phải mã nguồn mở không?
Có — nlohmann/exception_reporter phát hành theo license MIT, nghĩa là mã nguồn mở để đọc, fork và (tùy license) tái sử dụng. Mã: github.com/nlohmann/exception_reporter.
nlohmann/exception_reporter có tag gì không?
Bản đồng bộ chưa ghi nhận topic GitHub nào cho nlohmann/exception_reporter. GitHub topics hiển thị ở thanh bên phải trang repo — đó là nơi đáng kiểm tra nhất.
nlohmann/exception_reporter có trang demo không?
Dự án có trang chủ ở https://www.reddit.com/r/cpp/comments/clss2i/how_to_find_all_exceptions_a_function_could_throw/. Tab "Readme" ở trang này thường có ảnh chụp và hướng dẫn bắt đầu nhanh.
nlohmann/exception_reporter còn đang phát triển không?
Commit gần nhất trên nlohmann/exception_reporter là 7.3 năm trước (theo timestamp GitHub). Repo có 1 fork — một chỉ báo về mức độ quan tâm của cộng đồng.
Đọc đầy đủ README ở tab phía trên.
Chưa chắc exception_reporter có hợp với bạn?
Để ChatGPT, Claude hoặc Perplexity tìm hiểu giúp — bấm bên dưới và xem AI nói gì về exception_reporter.