Fork me on GitHub
#clojure-uk
<
2018-04-13
>
mccraigmccraig08:04:27

best error message in our whole system: error crossing the streams

πŸ‘ 12
πŸ‘» 4
yogidevbear08:04:48

Sounds like an episode of Billy Goat Gruff and the troll under the bridge

mccraigmccraig09:04:44

i was thinking ghostbusters, but i guess trolls are cool too troll

yogidevbear09:04:27

lol, ghostbusters is a much better observation

3Jane09:04:42

ghostbusters is the original source, but what I think of these days is that Magicka πŸ™‚

danm09:04:40

Haven't played that for yonks

danm09:04:59

Was fun 4 player, but then the folks I was playing with moved on to other things

maleghast10:04:08

Excellent Morning to you All πŸ™‚

3Jane11:04:34

now you have to tell us

3Jane11:04:50

or else the question of what it was will be bugging everyone else for the next 3 years

mccraigmccraig12:04:29

lol - so we use cassandra as our db, and it has no multi-table transactions... which means that it's always possible to have dangling entries from index-tables to primary tables (because of e.g. updates getting interrupted)

mccraigmccraig12:04:14

we've never implemented anything to deal with the dangling entries, because global solutions seem pretty heavyweight (full table scan of index tables, joining to primary tables etc)...

mccraigmccraig12:04:24

but it's just occurred to me that we can use our indexed retrieval op to lazily deal with inconsistencies - when a record is retrieved by an index entry, if the primary record no longer satisfies the index entry then don't return it and silently delete the index entry

mccraigmccraig12:04:47

simples, but i was just thinking about it wrongly

otfrom12:04:00

On demand clean up. Nice

3Jane12:04:09

oh yeah, nice πŸ™‚

3Jane12:04:21

like people re-hash passwords on demand

3Jane12:04:45

(not that it’s a good practice for passwords, but hey πŸ™‚ )

maleghast12:04:22

That is a cool solution πŸ™‚ Would you tie it up with re-creating the index correctly as well..?

mccraigmccraig12:04:09

you mean recreate all index entries for the primary record @maleghast ? that would probably make sense

maleghast12:04:23

Yeah, that's what I meant πŸ™‚

mccraigmccraig13:04:44

anyone know of any clojure libs which can turn an exception into something EDN serializable ? i would like to preserve most of the structure - type, message and stack trace, but not get barfage on reading the #error tag

otfrom13:04:59

exceptions as values really is what you are after?

mccraigmccraig13:04:31

no, not really that... we have something which encodes/decodes [tag value-map] variants to/from exception ex-data which works very nicely as a way of transmitting well-known error info around, but in the case of random exceptions it's sticking the exception itself in the value-map which is causing borkage when that value-map gets deserialized from EDN... i want to be able to turn an exception into something with equivalent diagnostic power which is deserializable

mccraigmccraig13:04:35

i guess i can do it easily enough myself, but i'd rather avoid the work 😬

mccraigmccraig13:04:16

doh - (with-out-str (print e)) is easy and satisfies my goal

sundarj13:04:06

@mccraigmccraig are you aware of clojure.core/Throwable->map?

✨ 8
mccraigmccraig13:04:11

i wasn't @sundarj - that was precisely what i was looking for - thanks!

8
mccraigmccraig15:04:27

anyone here using timbre for logging ?

otfrom15:04:31

yep, tho you'd want to talk to @acron about "using it in anger"

otfrom15:04:42

as all of my coding is just joy really πŸ™‚

acron15:04:53

@mccraigmccraig yep, we love timbre

mccraigmccraig15:04:52

yep, me too - but i have a minor annoyance - every time i attach CIDER to a terminal repl, all the timbre logging gets redirected to the emacs repl buffer

mccraigmccraig15:04:01

have you ever managed to stop this happening ?

mccraigmccraig15:04:50

emacs buffers don't do so well when they get 10ks of log lines suddenly appended 😬

acron15:04:55

is that not just CIDER attaching to stdout?

mccraigmccraig15:04:23

no, it's more subtle than that, since i no longer get the timbre logging on the terminal

acron15:04:38

Oh, fascinating

mccraigmccraig15:04:17

yes, but the annoying sort of fascinating

acron15:04:33

using cider-connect?

mccraigmccraig15:04:34

iirc it didn't used to happen, but somewhere between various upgrades it started happening and i've now ignored it once too often

acron15:04:04

when you say all the timbre logging gets redirected to the emacs repl buffer does that mean it stops being sent to terminal repl?

mccraigmccraig15:04:05

anyway, if you haven't seen it, don't bother about it... i was hoping someone had a "just do this" solution

mccraigmccraig16:04:11

turns out this is the solution - https://github.com/clojure-emacs/cider-nrepl/pull/474 - but it's not ready to merge yet, because it needs to be configurable