I am not sure whether error handling with monads is considered as best practice for Clojure but it seems quite popular (however, I still see exceptions to be used also a lot). Monads seem more functional approach to error handling. However, I am missing the stacktrace when using error monads. Is there a way how to get stacktrace when using monads? Or what is the alternative in here?
Stacktrace and error monads in Clojure
442 Views Asked by Viktor K. At
2
There are 2 best solutions below
0
Shantanu Kumar
On
Stack traces can be generated by saying (Exception. "msg") anywhere. I have been working on Promenade (see documentation) that can combine exceptions and errors-as-values. You should take a look if that sounds like a potential solution.
Related Questions in ERROR-HANDLING
- Simple movie API request not showing up in the console log
- Sends a personalised error message from the back-end to the front-end with Nuxt-auth
- Creating Chrome extension, but display text from Javascript file is not showing up on HTML's display. The HTML is the InnerHTML of another HTML file
- How do I fix the response: Error in contrasts in R
- new to express & js and trying to understand next
- How to implement a Higher Order Component using TypeScript?
- symbol not found in flat namespace '__PyTrash_begin
- Handling multiple errors in Bison parser
- getting error 422 (Unprocessable entity) in a api-integration webapp
- Handling errors in MSAL Redirect - reactjs login with microsoft sso
- Node.JS getting error while building EXE with PKG module
- How do I display Supabase AuthApiError from server-side in client -side
- VBA dynamic feed multiple files into current one but error of "Run-rime error 7 out of memory" occurs
- How do I fix subscript out of bound error for my interaction matrices?
- pyinstaller' is not recognized as an internal or external command, operable program or batch file
Related Questions in CLOJURE
- SSE implementation in Pedestal using individual channel per user
- Within a Clojure project using deps.edn, where is the package name and version tracked?
- How can I update and iterate the sub maps and update map into different location of map at the same time in clojure
- Out of memory in clojure - Nested reduce on Lazy Sequence
- Mac OS X - Brew installed Leiningen permission error / wrong directory
- Consume SpiceDB LookupResources gRPC stream from Clojure using Java gRPC library
- Server sent events in pedestal returns empty response
- How to make quarkus find my Clojure classes?
- Looking for a Clojure/LISP equivalent to Scons
- lazily calling functions for infinite sequence clojure
- Issue with Kafka in Clojure Repl for Arm64 M1
- Unable write parser where the AST can be turned into Clojure code
- Naming convention for simbol of clojure.core/atom, like !foo in Clojure
- How to nest a sequence of layered steps?
- How to type hint a float?
Related Questions in MONADS
- What should i use Exceptions or Monads for handle if service occur a problem?
- Is `Pair` a valid instance of `MonadRec`?
- Collecting errors (instead of short-circuiting) until value is actually being used
- Monad Map with two values in Java Functional Programming
- Turn a List of Iterators into an Iterator of Lists in Scala 3
- Haskell fails to infer the return type of a monad after using the sequence operator
- Codensity and ContT
- Pure functional way of creating a std::optional counterpart
- How do I spawn a shell command from X monad and get it output?
- Read instance for Associative Computations Tree
- Haskell [parse error, possibly incorrect indentation or mismatched brackets) parser
- Implementation of MonadState without using return?
- Is this a bug in Haskell implementation?
- Does a Maybe Monad collapses in Just or Nothing?
- How to use two different monads in the same do-expression?
Related Questions in STACK-TRACE
- Angular - NG SERVE doesnt work outta nowhere / node:internal/errors:563 ErrorCaptureStackTrace(err);
- Stack Tracing Considering the ARM assembly language version mentioned below
- Why "current_thread" identifier is not in "_current_frames" dictionary?
- Rails 7.1.3 how to view stack traces in a production environment
- Azure calls waiting a long time
- Looking for a tool to monitor process exceptions with stack traces in real-time
- C++23 std::stacktrace in segmentation fault
- VSCode Extension Development: Rejected Promise Error When Running "sonarqube-scanner-npm"
- Extracting function name from boost stacktrace
- In internal testing, application crashed on start with Fatal Exception: java.lang.VerifyError
- Get stacktrace including child class method call when exception is raised from parent classmethod
- Print stacktrace of a function from a goroutine
- Parsing multiline python logs in fluentbit issue
- How to interpret the stack trace of an obfuscated app
- How to create stack trace for other process(out of process) when it crashes in google breakpad?
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular # Hahtags
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
As muhuk says, you'd use a monad to avoid getting a stacktrace.
An article I discovered when answering another SO recently that relates to the one you linked is http://overwatering.org/blog/2013/12/clojures-thread-for-monads
It builds a
m->threading monad, and gives example of using it to produce afail->monad based on the work in the error monads article. It allows you to effectively return different error types during execution.