{"id":28120100,"url":"https://github.com/staticweb-io/aws-api-failjure","last_synced_at":"2025-07-26T22:09:06.382Z","repository":{"id":62433059,"uuid":"281461175","full_name":"staticweb-io/aws-api-failjure","owner":"staticweb-io","description":"A library for dealing with anomalies when using aws-api.","archived":false,"fork":false,"pushed_at":"2021-04-09T01:59:59.000Z","size":12,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-12T18:34:58.880Z","etag":null,"topics":["aws","aws-api","clojure","failjure"],"latest_commit_sha":null,"homepage":"","language":"Clojure","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/staticweb-io.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2020-07-21T17:25:33.000Z","updated_at":"2021-04-09T02:00:01.000Z","dependencies_parsed_at":"2022-11-01T21:01:08.134Z","dependency_job_id":null,"html_url":"https://github.com/staticweb-io/aws-api-failjure","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/staticweb-io/aws-api-failjure","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/staticweb-io%2Faws-api-failjure","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/staticweb-io%2Faws-api-failjure/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/staticweb-io%2Faws-api-failjure/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/staticweb-io%2Faws-api-failjure/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/staticweb-io","download_url":"https://codeload.github.com/staticweb-io/aws-api-failjure/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/staticweb-io%2Faws-api-failjure/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260933186,"owners_count":23084949,"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":["aws","aws-api","clojure","failjure"],"created_at":"2025-05-14T07:40:14.989Z","updated_at":"2025-07-26T22:09:06.376Z","avatar_url":"https://github.com/staticweb-io.png","language":"Clojure","readme":"# aws-api-failjure\n\n[![Clojars Project](https://img.shields.io/clojars/v/io.staticweb/aws-api-failjure.svg)](https://clojars.org/io.staticweb/aws-api-failjure)\n\nA library for dealing with anomalies when using [aws-api](https://github.com/cognitect-labs/aws-api). Provides helpers to turn anomalies into Clojure ExceptionInfo objects or into [failjure](https://github.com/adambard/failjure) Failure objects.\n\n## Install\n\nAdd to deps.edn:\n```edn\nio.staticweb/aws-api-failjure {:mvn/version \"1.1.0\"}\n```\n\nOr add to project.clj:\n```edn\n[io.staticweb/aws-api-failjure \"1.1.0\"]\n```\n\n## Usage\n\nCreate clients as you normally would using aws-api. This example requires you to have a `com.cognitect.aws/s3` dependency, but you can replace `{:api :s3}` with any other API that you have the dependency for.\n\n```clojure\n(require '[aws-api-failjure :as aaf]\n         '[cognitect.aws.client.api :as aws]\n         '[failjure.core :as f])\n\n(def client (aws/client {:api :s3}))\n```\n\n### failjure\n\nUse `aws-api-failjure/invoke` in place of aws-api's `invoke` to turn unsuccessful operations into Failure objects for use with failjure:\n\n```clojure\n(f/if-let-ok? [r (aaf/invoke client ,,,op-map,,,)]\n  r\n  (prn \"Request failed:\" (f/message r)))\n```\n\n### throwing-invoke\n\nUse `aws-api-failjure/throwing-invoke` to turn unsuccessful operations into clojure.lang.ExceptionInfo objects:\n\n```clojure\n(try\n  (aaf/throwing-invoke client ,,,op-map,,,)\n  (catch clojure.lang.ExceptionInfo e\n    (prn \"Request failed:\" (:message (ex-data e)))))\n```\n\n`(ex-data e)` is a map containing the keys `:client :message :op-map :result`.\n\n### aws/invoke\n\nYou can also use aws-api's invoke normally, check for the presence of `:cognitect.anomalies/category`, and use `aws-api-failjure/message` to retrieve a human-readable error message.\n\n```clojure\n(let [result (aws/invoke client ,,,op-map,,,)]\n  (if (:cognitect.anomalies/category result)\n    (prn \"Request failed:\" (aaf/message result))\n    result))\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstaticweb-io%2Faws-api-failjure","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstaticweb-io%2Faws-api-failjure","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstaticweb-io%2Faws-api-failjure/lists"}