This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2023-12-21
Channels
- # adventofcode (8)
- # announcements (20)
- # babashka (43)
- # beginners (8)
- # biff (12)
- # calva (2)
- # cider (5)
- # clerk (6)
- # clj-commons (12)
- # clj-kondo (16)
- # clojure (20)
- # clojure-denver (1)
- # clojure-europe (14)
- # clojure-nl (1)
- # clojure-norway (105)
- # clojure-uk (2)
- # clojuredesign-podcast (5)
- # clojurescript (29)
- # datomic (2)
- # hyperfiddle (13)
- # jackdaw (1)
- # jobs (4)
- # jobs-discuss (4)
- # lsp (2)
- # malli (12)
- # pathom (2)
- # pedestal (1)
- # re-frame (22)
- # shadow-cljs (37)
- # squint (28)
- # xtdb (28)
- # yamlscript (4)
What error handling patterns do people prefer when it comes to consuming “company internal” library functions in an application? I am considering returning keywords for various failure modes, like Datomic does with cognitect.anomalies
, but I also find value in letting the caller explicitly handle exceptions and nil return values.
For context: this function I am dealing with parses an XML document and uses zippers to find data with a certain shape then return an attribute of an element in that data.
---
question rephrased briefly: do you prefer propagating errors to callers or wrapping them in “nicer” interfaces?
My interpretation is that anomalies are more for propagating errors in distributed systems. If you have a large data center and something runs out of disk space, just throwing an exception on that machine alone isn't helpful, you need to send some data somewhere. But for your usage of a low level library I'd default to just throwing exceptions. You can always catch them and turn them into anomalies later.
For me it sounds like if there is a clear API between library code and consumers. And the API / business logic is well known defined. Maybe it's worth returning keywords as you would do with an http API. A long time ago I played around with hierarchical failure modes. Sounds a bit like what you are talking about. Project is old but maybe https://github.com/kardan/taxa can be of some kind of inspiration. If you decide to go down that path.
Hi, any idea why my taps are not returning any data to the portal window, unless I first print the value? From what I read it should evaluate the data at the same time of tap>, so even if it's lazy it should be visible there.
Sure sounds like you have a lazy-seq that calls tap> somewhere so that tap> doesn't happen until the seq is realized, which printing it would do
what I am saying is you have something like (map (fn [i] (tap> i)) '(1 2 3))
that produces a lazy seq, so the tapping of i
won't happen until the seq is realized
what is seems like you are asking about is (tap> x)
where x is a lazy seq(something like that is what I take "realized at tap>" to mean), which doesn't match the symptoms you described, the lazy seq with tapping does
they went defunct semi-recently, think there were some accounts of fraud business?
In March 2023, after central bank–endorsed interest rate hikes during the 2021–2023 inflation surge,[12][13][14][15] there was a bank run on its deposits, which led to its collapse and seizure on March 10, 2023 by the California Department of Financial Protection and Innovation (DFPI), its regulator.[16] Citing inadequate liquidity and insolvency, state officials at the DFPI appointed the Federal Deposit Insurance Corporation (FDIC) receiver of the bank.[16][17] This was, at the time, the second-largest bank failure in U.S. history, later surpassed by the collapse of First Republic Bank during the March 2023 United States bank failures.
Ah, I would just mention that they've been acquired/seized by someone, whatever the right terminology might be. No need to completely remove the entry, there are already similar things in there, like Braintree Payments (acquired by PayPal)
.
fair fair fair
SVB are still in business. Chapter 11 doesn't mean they've gone away). There are several companies on that list that have ceased to exist or got acquired/changed their names.
thats fair, i just recall it being a pretty high-profile failure at the time
No, but I guess the point is kind of "by association". Hey, look who uses Clojure! This bank that tanked because of shady business practices and took everyone's money with them. Not exactly endorsement material, regardless of how solid the tech may have been. :man-shrugging::skin-tone-2: Doesn't really bother me though
Did FTX use Clojure too? 😂