{"id":15497242,"url":"https://github.com/jwerle/throw.h","last_synced_at":"2025-03-14T03:17:51.636Z","repository":{"id":11184798,"uuid":"13563311","full_name":"jwerle/throw.h","owner":"jwerle","description":"Create and throw errors easily","archived":false,"fork":false,"pushed_at":"2014-01-25T15:45:56.000Z","size":132,"stargazers_count":4,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-17T01:14:58.118Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"fb55/readabilitySAX","license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jwerle.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}},"created_at":"2013-10-14T14:19:49.000Z","updated_at":"2022-02-27T20:38:29.000Z","dependencies_parsed_at":"2022-08-31T03:21:14.140Z","dependency_job_id":null,"html_url":"https://github.com/jwerle/throw.h","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/jwerle%2Fthrow.h","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jwerle%2Fthrow.h/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jwerle%2Fthrow.h/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jwerle%2Fthrow.h/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jwerle","download_url":"https://codeload.github.com/jwerle/throw.h/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243515525,"owners_count":20303258,"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-02T08:32:16.672Z","updated_at":"2025-03-14T03:17:51.604Z","avatar_url":"https://github.com/jwerle.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"throw.h\n=======\n\nCreate and throw errors easily\n\n## install\n\nWith [clib](https://github.com/clibs/clib)\n\n```sh\n$ clib install jwerle/throw.h\n```\n\n## usage\n\n```c\n\n#include \"throw.h\"\n\nint\nmain (void) {\n  error_t eperm = error_new(EPERM, \"EPERM\");\n  error_t enoent = error_new(ENOENT, \"ENOENT\");\n  error_t esrch = error_new(ESRCH, \"ESRCH\");\n  error_t eintr = error_new(EINTR, \"EINTR\");\n\n  throw(\u0026eperm, \"Operation not permitted\");\n  throw(\u0026enoent, \"No such file or directory\");\n  throw(\u0026esrch, \"No such process\");\n  throw(\u0026eintr, \"Interrupted system call\");\n\n  return 0;\n}\n```\n\nYou can also set the stream where errors are written to by defining the\n`THROW_FD` file descriptor.\n\n```c\nTHROW_FD = stderr; // or some other `FILE *` pointer\n```\n\n## license\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjwerle%2Fthrow.h","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjwerle%2Fthrow.h","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjwerle%2Fthrow.h/lists"}