Closed behrica closed 2 years ago
Hi Carsten,
Yes, you have two options:
*freeze-fallback*
to the keyword value :write-unfreezable
.*freeze-fallback*
to the function value taoensso.nippy/write-unfreezable
.There's an important difference between these:
Will try to freeze an object using Java Serializable (which can be error-prone). If that fails, it'll try using Clojure's reader (which can be slow, and sometimes also error-prone). If that fails, it'll use taoensso.nippy/write-unfreezable
to essentially serialize an error message (always works, but of limited value if you want to be able to reconstruct the frozen object).
Will just immediately resort to using taoensso.nippy/write-unfreezable
- i.e. will always work and always be fast, but you'll basically just be serializing an error message.
Put it differently:
thanks, very helpfull
Related to https://github.com/ptaoussanis/nippy/issues/141, but more focussed question.
Is there a way to freeze an arbitrary data structure, while ignoring all errors due to non freezable types ? "ignoring" could mean putting nil or leaving out or replace by "dummy".