{"id":14066583,"url":"https://github.com/sckott/fauxpas","last_synced_at":"2025-12-12T00:54:32.430Z","repository":{"id":62794297,"uuid":"56184161","full_name":"sckott/fauxpas","owner":"sckott","description":"fauxpas does http errors","archived":false,"fork":false,"pushed_at":"2023-10-14T18:42:11.000Z","size":291,"stargazers_count":14,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-23T20:14:54.382Z","etag":null,"topics":["error-handling","http","r","r-package","rstats"],"latest_commit_sha":null,"homepage":"https://sckott.github.io/fauxpas","language":"R","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/sckott.png","metadata":{"files":{"readme":"README.Rmd","changelog":null,"contributing":".github/CONTRIBUTING.md","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}},"created_at":"2016-04-13T20:33:33.000Z","updated_at":"2025-03-22T11:20:01.000Z","dependencies_parsed_at":"2023-10-15T17:18:41.327Z","dependency_job_id":null,"html_url":"https://github.com/sckott/fauxpas","commit_stats":{"total_commits":90,"total_committers":3,"mean_commits":30.0,"dds":"0.033333333333333326","last_synced_commit":"6c45f87f0651ce1db829c116ad273481d546ad79"},"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sckott%2Ffauxpas","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sckott%2Ffauxpas/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sckott%2Ffauxpas/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sckott%2Ffauxpas/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sckott","download_url":"https://codeload.github.com/sckott/fauxpas/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250506141,"owners_count":21441723,"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":["error-handling","http","r","r-package","rstats"],"created_at":"2024-08-13T07:05:10.387Z","updated_at":"2025-12-12T00:54:32.423Z","avatar_url":"https://github.com/sckott.png","language":"R","readme":"fauxpas\n=======\n\n```{r echo=FALSE}\nknitr::opts_chunk$set(\n  warning = FALSE,\n  message = FALSE,\n  collapse = TRUE,\n  comment = \"#\u003e\",\n  eval = FALSE\n)\n```\n\n[![R-check](https://github.com/sckott/fauxpas/actions/workflows/R-check.yml/badge.svg?branch=main)](https://github.com/sckott/fauxpas/actions/workflows/R-check.yml)\n[![cran checks](https://badges.cranchecks.info/worst/fauxpas.svg)](https://github.com/sckott/fauxpas)\n[![cran version](http://www.r-pkg.org/badges/version/fauxpas)](https://cran.r-project.org/package=fauxpas)\n[![rstudio mirror downloads](https://cranlogs.r-pkg.org/badges/fauxpas)](https://github.com/r-hub/cranlogs.app)\n\n`fauxpas` does http errors\n\n* HTTP error classes more in line with Ruby/Python/Etc.\n* An error class for each HTTP status in case a user wants to\nbe specific to an HTTP status code, and general purpose handlers\nfor any error\n* Work with any of the major R http clients: `crul`, `curl`, `httr`, (maybe\n`RCurl` later)\n* Provide flexiblity for what to do on an HTTP error, including\ncustom functions and message templates\n\nInfo Links:\n\n* HTTP on wikipedia: \u003chttps://en.wikipedia.org/wiki/Hypertext_Transfer_Protocol\u003e\n* HTTP2 on wikipedia: \u003chttps://en.wikipedia.org/wiki/HTTP/2\u003e\n* HTTP/1.1: \u003chttps://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html\u003e\n* HTTP/2: \u003chttps://datatracker.ietf.org/doc/html/rfc7540\u003e\n\n## Install\n\nCRAN version\n\n```{r}\ninstall.packages(\"fauxpas\")\n```\n\nDev version\n\n```{r}\nremotes::install_github(\"sckott/fauxpas\")\n```\n\n```{r}\nlibrary(\"fauxpas\")\n```\n\n## use with crul\n\n```{r}\nlibrary(\"crul\")\ncli \u003c- HttpClient$new(\"https://httpbin.org/status/414\")\nres \u003c- cli$get()\nhttp(res)\n#\u003e Error: Request-URI Too Long (HTTP 414).\nhttp414(res)\n#\u003e Error: Request-URI Too Long (HTTP 414).\n```\n\n```{r}\nx \u003c- HTTPRequestURITooLong$new()\nx$do_verbose(res)\n#\u003e Error: Request-URI Too Long (HTTP 414).\n#\u003e - The server is refusing to service the request because the Request-URI is\n#\u003e    longer than the server is willing to interpret. This rare condition is only likely\n#\u003e    to occur when a client has improperly converted a POST request to a GET request\n#\u003e    with long query information, when the client has descended into a URI black hole\n#\u003e    of redirection (e.g., a redirected URI prefix that points to a suffix of itself),\n#\u003e    or when the server is under attack by a client attempting to exploit security\n#\u003e    holes present in some servers using fixed-length buffers for reading or\n#\u003e    manipulating the Request-URI.\n```\n\n## use with curl\n\n```{r}\nlibrary(\"curl\")\nh \u003c- curl::new_handle()\ncurl::handle_setopt(h)\nresp \u003c- curl::curl_fetch_memory(\"https://httpbin.org/status/404\", h)\nhttp(resp)\n#\u003e Error: Not Found (HTTP 404).\nhttp404(resp)\n#\u003e Error: Not Found (HTTP 404).\n```\n\n```{r}\nx \u003c- HTTPNotFound$new()\nx$do_verbose(resp)\n#\u003e Error:  Not Found (HTTP 404).\n#\u003e  - The server has not found anything matching the Request-URI. No indication is\n#\u003e given of whether the condition is temporary or permanent. The 410 (Gone) status\n#\u003e code SHOULD be used if the server knows, through some internally configurable\n#\u003e mechanism, that an old resource is permanently unavailable and has no forwarding\n#\u003e address. #\u003e This status code is commonly used when the server does not wish to\n#\u003e reveal exactly why the request has been refused, or when no other response is\n#\u003e applicable.\n```\n\n## use with httr\n\n```{r}\nlibrary(\"httr\")\nres \u003c- GET(\"https://httpbin.org/status/405\")\nhttp405(res)\n#\u003e Error: Method Not Allowed (HTTP 405).\n```\n\n```{r}\nx \u003c- HTTPMethodNotAllowed$new()\nx$do_verbose(res)\n#\u003e Error: Method Not Allowed (HTTP 405).\n#\u003e  - The method specified in the Request-Line is not allowed for the resource\n#\u003e identified by the Request-URI. The response MUST include an Allow header\n#\u003e containing a list of valid methods for the requested resource.\n```\n\n## Meta\n\n* Please [report any issues or bugs](https://github.com/sckott/fauxpas/issues)\n* License: MIT\n* Get citation information for `fauxpas` in R doing `citation(package = 'fauxpas')`\n* Please note that the fauxpas project is released with a [Contributor Code of Conduct](https://contributor-covenant.org/version/2/1/CODE_OF_CONDUCT.html). By contributing to this project, you agree to abide by its terms.\n","funding_links":[],"categories":["R"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsckott%2Ffauxpas","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsckott%2Ffauxpas","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsckott%2Ffauxpas/lists"}