{"id":20805733,"url":"https://github.com/danbugs/wit-error-rs","last_synced_at":"2026-05-27T18:32:32.542Z","repository":{"id":38054415,"uuid":"506412973","full_name":"danbugs/wit-error-rs","owner":"danbugs","description":"The closest I could get to providing an user-experience like the thiserror crate for WIT generated code","archived":false,"fork":false,"pushed_at":"2022-06-22T23:46:54.000Z","size":19,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-12T03:33:40.398Z","etag":null,"topics":["rust","webassembly","wit"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"agpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/danbugs.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-06-22T21:37:01.000Z","updated_at":"2022-06-22T23:58:30.000Z","dependencies_parsed_at":"2022-08-18T19:11:10.223Z","dependency_job_id":null,"html_url":"https://github.com/danbugs/wit-error-rs","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/danbugs/wit-error-rs","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danbugs%2Fwit-error-rs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danbugs%2Fwit-error-rs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danbugs%2Fwit-error-rs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danbugs%2Fwit-error-rs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/danbugs","download_url":"https://codeload.github.com/danbugs/wit-error-rs/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danbugs%2Fwit-error-rs/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33579665,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-05-27T02:00:06.184Z","response_time":53,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["rust","webassembly","wit"],"created_at":"2024-11-17T19:16:07.234Z","updated_at":"2026-05-27T18:32:32.526Z","avatar_url":"https://github.com/danbugs.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# `wit-error-rs`\r\n\r\nThis is the closest I could get to an user-experience similar to the `thiserror` Rust crate.\r\n\r\n## How To Use\r\n\r\nIn your `Cargo.toml`, add:\r\n\r\n```\r\nwit-error-rs = { git = \"https://github.com/danbugs/wit-error-rs\", rev = \"05362f1a4a3a9dc6a1de39195e06d2d5d6491a5e\" }\r\n```\r\n\r\nIf, in your wit, you have type that you want to classify as an Error type (i.e., should implement `std::error::Error`), like:\r\n```\r\n// file error.wit\r\nvariant error {\r\n    error-with-description(string)\r\n}\r\n```\r\n\r\nYou can use `wit-error-rs` to classify it that way, like so:\r\n```rs\r\n// wit_bindgen_rust::export!(\"\u003cpath\u003e/\u003cto\u003e/error.wit\"); \u003c- assumed\r\nwit_error-rs::impl_error!(error::Error);\r\n```\r\n\r\nIn addition, you can convert from things like `anyhow::Error` to your own `error::Error`, like so:\r\n```rs\r\n// wit_bindgen_rust::export!(\"\u003cpath\u003e/\u003cto\u003e/error.wit\"); \u003c- assumed\r\nwit_error-rs::impl_from!(anyhow::Error, error::Error::ErrorWithDescription);\r\n```\r\n\r\nFor a more detailed explanation and usage, refer to the examples directory.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdanbugs%2Fwit-error-rs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdanbugs%2Fwit-error-rs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdanbugs%2Fwit-error-rs/lists"}