Liking cljdoc? Tell your friends :D

GCP Simple Error Reporting 🍻 for Clojure

Clojars Project cljdoc badge

ser

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 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.

(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.

(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.

Can you improve this documentation? These fine people already did:
Vale & ERDOS Balint
Edit on GitHub

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close