{"id":15706675,"url":"https://github.com/msdn-whiteknight/errlib","last_synced_at":"2025-06-16T02:03:57.161Z","repository":{"id":37042355,"uuid":"146988135","full_name":"MSDN-WhiteKnight/ErrLib","owner":"MSDN-WhiteKnight","description":"C/C++ exception handling and logging library","archived":false,"fork":false,"pushed_at":"2024-12-06T17:58:40.000Z","size":463,"stargazers_count":5,"open_issues_count":1,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-06-16T02:03:52.185Z","etag":null,"topics":["c","cpp","error-handling","exceptions","library","logging","windows"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/MSDN-WhiteKnight.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2018-09-01T10:11:26.000Z","updated_at":"2024-12-06T17:58:44.000Z","dependencies_parsed_at":"2025-05-12T19:00:48.708Z","dependency_job_id":"af990b13-449d-4b34-83be-50fa68a18772","html_url":"https://github.com/MSDN-WhiteKnight/ErrLib","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/MSDN-WhiteKnight/ErrLib","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MSDN-WhiteKnight%2FErrLib","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MSDN-WhiteKnight%2FErrLib/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MSDN-WhiteKnight%2FErrLib/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MSDN-WhiteKnight%2FErrLib/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MSDN-WhiteKnight","download_url":"https://codeload.github.com/MSDN-WhiteKnight/ErrLib/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MSDN-WhiteKnight%2FErrLib/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260083861,"owners_count":22956407,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["c","cpp","error-handling","exceptions","library","logging","windows"],"created_at":"2024-10-03T20:26:19.915Z","updated_at":"2025-06-16T02:03:57.153Z","avatar_url":"https://github.com/MSDN-WhiteKnight.png","language":"C++","readme":"# ErrLib\n\n[![Nuget](https://img.shields.io/nuget/v/SmallSoft.ErrLib)](https://www.nuget.org/packages/SmallSoft.ErrLib/)\n\n[Documentation](https://msdn-whiteknight.github.io/ErrLib/) | [Examples](/Examples/)\n\nA library to assist in dealing with exceptions and errors in C/C++ Windows Applications\n\n**Author:** MSDN.WhiteKnight (https://github.com/MSDN-WhiteKnight)\n\n**License:** BSD 3-clause\n\n**Requirements:** Windows Vista (or newer), Visual Studio 2010 (or newer)\n\n## Features\n\n- Simple way to get exception code, error message and stack trace in the handler block for SEH and C++ exceptions\n- Executing user-defined callback function on unhandled SEH exception\n- Converting WinAPI/COM errors into exceptions\n- Configurable logging: can write diagnostic information into log file, stderr stream, Windows Event Log or other targets\n- Multithreaded: all functionality can be used from different threads independently\n- All string processing in Unicode (wide characters)\n\n-----------------------------------------------------------------------------\n\n## Usage\n\n1. Copy header files (ErrLib.h and/or ErrLib_CPP.h) into one of your include file directories (or just into the project directory)\n2. Copy the correct version of ErrLib.lib into one of your lib file directories (or just into the project directory)\n3. Copy the correct version of ErrLib.dll into your project output directory (you must distribute it with your application on target machines)\n4. Include header files in one or more of your modules and have fun using ErrLib functions (see documentation)!\n\n**Notes:**\n\n- You must use LIB and DLL file version matching your project target architecture (x86/x64) and configuration type (Debug/Release)\n- ErrLib dynamically links to Visual C++ 2012 Standard Library (CRT) - debug or release depending on version. This means, either target machines must have Visual C++ 2012 Redistributable installed, or you must redistribute its DLLs along with your application. For any other deployment option, rebuid project from sources, changing configuration accordingly.\n- You can use ErrLib via LoadLibrary/GetProcAddress if you really want, but don't call FreeLibrary. Unloading ErrLib before process termination is not supported.\n\nSimple usage example:\n\n```\n#include \u003cstdio.h\u003e\n#include \"ErrLib.h\"\n#include \"ErrLib_CPP.h\"\n\n// Function that throws exception when parameter value is invalid\nfloat CalcRectangleArea(float width, float height){\n    if(width\u003c=0.0) throw ErrLib::Exception(L\"Width must be positive\");\n    if(height\u003c=0.0) throw ErrLib::Exception(L\"Height must be positive\");\n\n    return width * height;\n}\n\nvoid func1(){\n    float s = CalcRectangleArea(0.0, 2.0);\n    wprintf(L\"%f\\n\", s);\n}\n\nvoid func(){\n    try\n    {\n        func1();\n    }\n    catch(ErrLib::Exception\u0026 ex)\n    {\n        // Catch exception and print diagnostic information\n        wprintf(L\"Exception: %s\\n%s\", ex.GetMsg().c_str(), ex.PrintStackTrace().c_str());\n    }\n}\n\nint main()\n{\n    ErrLib_Initialize();\n\n    func();\n\n    getchar();\n    return 0;\n}\n\n/* Example output:\n\nException: Width must be positive\n  in ErrLib_Demo.exe!CalcRectangleArea + 0x7c (c:\\repos\\errlib\\errlib_demo\\main.cpp; line: 10;)\n  in ErrLib_Demo.exe!func1 + 0x3f (c:\\repos\\errlib\\errlib_demo\\main.cpp; line: 17;)\n  in ErrLib_Demo.exe!func + 0x50 (c:\\repos\\errlib\\errlib_demo\\main.cpp; line: 25;)\n  in ErrLib_Demo.exe!main + 0x28 (c:\\repos\\errlib\\errlib_demo\\main.cpp; line: 39;)\n  in ErrLib_Demo.exe!__tmainCRTStartup + 0x199 (f:\\dd\\vctools\\crt_bld\\self_x86\\crt\\src\\crtexe.c; line: 536;)\n  in ErrLib_Demo.exe!mainCRTStartup + 0x0d (f:\\dd\\vctools\\crt_bld\\self_x86\\crt\\src\\crtexe.c; line: 377;)\n  in KERNEL32.DLL!BaseThreadInitThunk (C:\\WINDOWS\\System32\\KERNEL32.DLL; address: 0x7781fa29)\n  in ntdll.dll!RtlGetAppContainerNamedObjectPath (C:\\WINDOWS\\SYSTEM32\\ntdll.dll; address: 0x77967a9e)\n  in ntdll.dll!RtlGetAppContainerNamedObjectPath (C:\\WINDOWS\\SYSTEM32\\ntdll.dll; address: 0x77967a6e)\n*/\n```\n\nFor more code examples, see [Examples](/Examples/) subdirectory. For a list of functions, see [API Documentation](https://msdn-whiteknight.github.io/ErrLib/_err_lib_8h.html#func-members).\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmsdn-whiteknight%2Ferrlib","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmsdn-whiteknight%2Ferrlib","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmsdn-whiteknight%2Ferrlib/lists"}