All Projects β†’ liquidz β†’ merr

liquidz / merr

Licence: other
πŸ”₯ Minimal and good enough error handling library for Clojure/ClojureScript

Programming Languages

clojure
4091 projects
Makefile
30231 projects

Projects that are alternatives of or similar to merr

of
🍬 Promise wrapper with sugar 🍬
Stars: ✭ 13 (-48%)
Mutual labels:  error-handling
custom-exception-middleware
Middleware to catch custom or accidental exceptions
Stars: ✭ 30 (+20%)
Mutual labels:  error-handling
failure
Error management
Stars: ✭ 1,448 (+5692%)
Mutual labels:  error-handling
custom error
Define custom errors without boilerplate using the custom_error! macro.
Stars: ✭ 70 (+180%)
Mutual labels:  error-handling
babel-errors
Nicer error messages for Babel
Stars: ✭ 15 (-40%)
Mutual labels:  error-handling
bugsnag
Report errors with Bugsnag πŸ›
Stars: ✭ 37 (+48%)
Mutual labels:  error-handling
raygun4py
Python provider for Raygun
Stars: ✭ 18 (-28%)
Mutual labels:  error-handling
miette
Fancy upgrade to std::error::Error.
Stars: ✭ 945 (+3680%)
Mutual labels:  error-handling
retryx
Promise-based retry workflow library.
Stars: ✭ 21 (-16%)
Mutual labels:  error-handling
react-error-guard
βš›οΈAn overlay for displaying stack frames based on create-react-app/packages/react-error-overlay
Stars: ✭ 18 (-28%)
Mutual labels:  error-handling
node-graceful-shutdown
Gracefully shutdown your modular NodeJS application.
Stars: ✭ 20 (-20%)
Mutual labels:  error-handling
safe
πŸ›‘ PHP functions smarten up to throw exceptions instead of returning false or triggering errors.
Stars: ✭ 15 (-40%)
Mutual labels:  error-handling
result17
A rust like Result type for modern C++
Stars: ✭ 13 (-48%)
Mutual labels:  error-handling
kotlin-multiplatform-example
A Kotlin multiplatform example app that targets Android, ReactJS, iOS, JavaFx, and Spring Boot
Stars: ✭ 115 (+360%)
Mutual labels:  error-handling
failure
An error handling package for Go.
Stars: ✭ 24 (-4%)
Mutual labels:  error-handling
nested-error-stacks
A node.js module for creating Error objects with nested Errors in stacktraces
Stars: ✭ 86 (+244%)
Mutual labels:  error-handling
static-404
⚑️ A WordPress plugin to quickly send a 404 for missing static files
Stars: ✭ 24 (-4%)
Mutual labels:  error-handling
fejl
Error-making utility for Node apps.
Stars: ✭ 30 (+20%)
Mutual labels:  error-handling
progress-bar-log
A component to display a progress bar and last X logs at the same time.
Stars: ✭ 44 (+76%)
Mutual labels:  error-handling
superagent-intercept
Add functions that will be called during end() e.g. for handling error conditions without having the same code all over the place.
Stars: ✭ 23 (-8%)
Mutual labels:  error-handling

merr

GitHub Actions for test workflow GitHub Actions for lint workflow GitHub Actions for dependencies workflow codecov Clojars Project cljdoc badge

Minimal and good enough error handling library for Clojure/ClojureScript

This library is based on "Good Enough" error handling in Clojure.

Concept

  • Easy to imagine behavior

  • Minimum to remember

    • All usage and examples are documented in docstring

(require '[merr.core :as merr])
;; => nil

;; for ClojureScript
;; (require '[merr.core :as merr :include-macros true])

(merr/let +err+ [foo 1
                 bar (merr/err)
                 baz (* bar 2)]
  {:+err+ +err+ :foo foo :bar bar :baz baz})
;; => {:+err+ (merr/err), :foo 1, :bar nil, :baz nil}

Usage

error record

(defrecord MerrError [type message data cause])

let

(merr/let err [a 10
               b (inc a)
               c (inc b)]
  (if err
    (merr/message err)
    (str "c = " c)))
;; => "c = 12"

(merr/let err [a 10
               b (merr/err {:message "ERROR"})
               c (inc b)]
  (if err
    (merr/message err)
    (str "c = " c)))
;; => "ERROR"

β†’

(merr/-> 10 (+ 1) (- 1))
;; => 10

(merr/-> 10 ((fn [_] (merr/err))) (- 1))
;; => (merr/err)

β†’>

(merr/->> 10 (+ 1) (- 1))
;; => -10

(merr/->> 10 ((fn [_] (merr/err))) (- 1))
;; => (merr/err)

Integration

clj-kondo

merr provies clj-kondo’s configuration and hooks. To import configurations, run the following command.

clj-kondo --no-warnings --lint "$(clojure -Spath -Sdeps '{:deps {merr/merr {:mvn/version "LATEST"}}}')"

And update :config-paths as below.

{
 :config-paths ["testdoc/testdoc"]
 }

License

Copyright Β© 2018-2021 Masashi Iizuka

Distributed under the Eclipse Public License either version 1.0 or (at your option) any later version.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].