Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/valerauko/gcp-ser-clj
A Clojure library trying to make reporting errors to Google Cloud's Error Reporting system (Stackdriver) simpler π»
https://github.com/valerauko/gcp-ser-clj
clojure error-reporting gcp google-cloud hacktoberfest monitoring stackdriver
Last synced: 3 months ago
JSON representation
A Clojure library trying to make reporting errors to Google Cloud's Error Reporting system (Stackdriver) simpler π»
- Host: GitHub
- URL: https://github.com/valerauko/gcp-ser-clj
- Owner: valerauko
- License: epl-2.0
- Created: 2021-04-06T05:10:11.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2023-10-04T06:52:19.000Z (over 1 year ago)
- Last Synced: 2024-09-28T03:23:25.856Z (4 months ago)
- Topics: clojure, error-reporting, gcp, google-cloud, hacktoberfest, monitoring, stackdriver
- Language: Clojure
- Homepage:
- Size: 51.8 KB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
# GCP Simple Error Reporting π» for Clojure
[![Clojars Project](https://img.shields.io/clojars/v/gcp-ser-clj.svg)](https://clojars.org/gcp-ser-clj) [![cljdoc badge](https://cljdoc.org/badge/gcp-ser-clj/gcp-ser-clj)](https://cljdoc.org/d/gcp-ser-clj/gcp-ser-clj/CURRENT)
>[ser](https://en.wiktionary.org/wiki/ser#Hungarian)
>
>Noun, Hungarian
>
>[ΛΚΙr] (_countable and uncountable, plural serek_)
>
>(_archaic, dialectal, humorous_) Alternative form of sΓΆr (βbeerβ).A Clojure library trying to make reporting errors to Google Cloud's Error Reporting system (Stackdriver) simpler.
## Usage
Check the [documentation on cljdoc](https://cljdoc.org/d/gcp-ser-clj/gcp-ser-clj/CURRENT) for more details about available options.
Unless running on Google Compute Engine, you'll probably need to set the `GOOGLE_APPLICATION_CREDENTIALS` environment variable to point to your credentials file (usually a proto.json).
### Using `report`
You can use the `report` directly to easily report an error to GCP.
```clojure
(try
(throw (ex-info "Something bad happened" {:important :data}))
(catch Throwable ex
(report ex))
```### Using `with-error-reporting`
`with-error-reporting` makes reporting even easier, as it automatically reports the exceptions that occur in its scope. It re-throws the exceptions so you can decide how to handle them in your application.
```clojure
(with-error-reporting
(throw (ex-info "Something bad happened" {:important :data})))
```## License
Copyright Β© 2021 @valerauko
This program and the accompanying materials are made available under the
terms of the Eclipse Public License 2.0 which is available at
http://www.eclipse.org/legal/epl-2.0.This Source Code may also be made available under the following Secondary
Licenses when the conditions for such availability set forth in the Eclipse
Public License, v. 2.0 are satisfied: GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or (at your
option) any later version, with the GNU Classpath Exception which is available
at https://www.gnu.org/software/classpath/license.html.