{"id":15674395,"url":"https://github.com/zkat/thisdiagnostic","last_synced_at":"2025-05-06T22:56:55.294Z","repository":{"id":57669693,"uuid":"391539893","full_name":"zkat/thisdiagnostic","owner":"zkat","description":"Add nice user-facing diagnostics to your errors without being weird about it.","archived":false,"fork":false,"pushed_at":"2021-08-02T16:13:59.000Z","size":17,"stargazers_count":14,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-05-06T22:56:43.069Z","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":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zkat.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-08-01T05:54:44.000Z","updated_at":"2025-04-15T15:12:42.000Z","dependencies_parsed_at":"2022-09-26T20:40:33.670Z","dependency_job_id":null,"html_url":"https://github.com/zkat/thisdiagnostic","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/zkat%2Fthisdiagnostic","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zkat%2Fthisdiagnostic/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zkat%2Fthisdiagnostic/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zkat%2Fthisdiagnostic/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zkat","download_url":"https://codeload.github.com/zkat/thisdiagnostic/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252782482,"owners_count":21803383,"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-03T15:44:15.840Z","updated_at":"2025-05-06T22:56:55.273Z","avatar_url":"https://github.com/zkat.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# thisdiagnostic\n\n`thisdiagnostic` is a Rust library for adding rich diagnostic metadata to\nerrors, for some really fancy and customizable error reporting!\n\n## Example\n\n### What You Write\n\n```rust\nuse thisdiagnostic::Diagnostic;\nuse thiserror::Error;\n\n#[derive(Error, Debug, Diagnostic)]\npub enum ApiError {\n    /// Returned when a generic http client-related error has occurred.\n    #[label(\"mytool::api::generic_http\")]\n    #[error(\"Request error:\\n\\t{0}\")]\n    HttpError(Box\u003cdyn std::error::Error + Send + Sync\u003e, String),\n\n    /// Returned when a URL failed to parse.\n    #[label(\"mytool::api::invalid_url\")]\n    #[help(\"Check the URL syntax. URLs must include the protocol part (https://, etc)\")]\n    #[error(transparent)]\n    UrlParseError(#[from] Box\u003cdyn std::error::Error + Send + Sync\u003e),\n\n    /// An API key is required.\n    #[label(\"mytool::api::needs_api_key\")]\n    #[help(\"Please supply an API key.\")]\n    #[error(\"Endpoint operation requires an API key.\")]\n    NeedsApiKey,\n\n    /// Unexpected response\n    #[label(\"mytool::api::unexpected_response\")]\n    #[help(\"This is likely a bug with the server API (or its documentation). Please report it.\")]\n    #[error(\"Unexpected or undocumented response.\")]\n    BadResponse,\n}\n```\n\n### What You Get\n\n```ignore\n$ ./mytool\nError: mytool::api::needs_api_key\n\nEndpoint operation requires an API key.\n\nhelp: Please supply an API key.\n```\n\n## License\n\nThis project and any contributions to it are [licensed under Apache 2.0](LICENSE.md).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzkat%2Fthisdiagnostic","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzkat%2Fthisdiagnostic","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzkat%2Fthisdiagnostic/lists"}