{"id":16916132,"url":"https://github.com/zesterer/errant","last_synced_at":"2025-04-11T16:23:36.567Z","repository":{"id":66134561,"uuid":"451465339","full_name":"zesterer/errant","owner":"zesterer","description":"A (mostly) drop-in replacement for Rust's Result that provides backtrace support.","archived":false,"fork":false,"pushed_at":"2022-01-26T10:36:58.000Z","size":6,"stargazers_count":25,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-11T16:23:22.061Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zesterer.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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}},"created_at":"2022-01-24T12:59:37.000Z","updated_at":"2024-11-06T22:06:32.000Z","dependencies_parsed_at":"2023-05-04T08:37:09.912Z","dependency_job_id":null,"html_url":"https://github.com/zesterer/errant","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zesterer%2Ferrant","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zesterer%2Ferrant/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zesterer%2Ferrant/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zesterer%2Ferrant/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zesterer","download_url":"https://codeload.github.com/zesterer/errant/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248438632,"owners_count":21103443,"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":[],"created_at":"2024-10-13T19:25:07.784Z","updated_at":"2025-04-11T16:23:36.554Z","avatar_url":"https://github.com/zesterer.png","language":"Rust","readme":"# Errant\n\nA (mostly) drop-in replacement for Rust's `Result` that provides backtrace support.\n\n*Please note that Errant is still very early in development and is not yet ready for general use.*\n\n## Example\n\nHere's an example of errant being used to trace a runtime error.\n\n```rs\nuse errant::prelude::*;\n\nfn baz(_: i32) -\u003e Result\u003ci32, \u0026'static str\u003e {\n    Err(\"Uh oh!\")\n}\n\nfn bar(x: i32, y: i32) -\u003e Result\u003ci32, \u0026'static str\u003e {\n    Ok(baz(x)? + y)\n}\n\nfn foo(x: i32) -\u003e Result\u003ci32, \u0026'static str\u003e {\n    Ok(bar(x, 3)? * 2)\n}\n\nfn main() -\u003e Result\u003c(), \u0026'static str\u003e {\n    foo(3)?;\n    Ok(())\n}\n```\n\nThe result of this program is as follows (color omitted).\n\n```\nError: \"Uh oh!\"\n    ╭─[examples/hello.rs:1:1]\n    │\n  4 │     Err(\"Uh oh!\")\n    ·     ┬\n    ·     ╰── Error encountered here\n  8 │     Ok(baz(x)? + y)\n    ·        ┬\n    ·        ╰── (1) Then propagated here\n 12 │     Ok(bar(x, 3)? * 2)\n    ·        ┬\n    ·        ╰── (2) Then propagated here\n 16 │     foo(3)?;\n    ·     ┬\n    ·     ╰── (3) Then propagated here\n────╯\n```\n\nGive it a go with the following command.\n\n```\ncargo run --example hello\n```\n\n## Design\n\nErrant provides a replacement for `std`'s `Result\u003cT, E\u003e` type that automatically tracks error propagation through a\nprogram, generating a backtrace. In addition, it also provides a variety of error wrapper types that can be used to\nembellish errors with extra context when desired, such as the `Backtrace\u003cE\u003e` error. When a panic occurs, Errant will\ndisplay a backtrace of the error that includes useful information like propagation locations, context provided along\nthe way, and more.\n\n## Philosophy\n\n- Errors should be types, not trait objects\n- Errors should point to their source and show their path through the program\n- Errors should be zero-cost, requiring no (or very little) overhead in release mode\n\n## License\n\n`errant` is distributed under either of:\n\n- Apache License, Version 2.0, (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)\n\n- MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzesterer%2Ferrant","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzesterer%2Ferrant","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzesterer%2Ferrant/lists"}