I am using Marshal class to serialize a Ruby object, using the functions: dump() and load() everything works well, but when a value not related to any serialized data is passed, the load() function returns the expected and logical error:
incompatible marshal file format (can't be read)
format version 4.8 required; 45.45 given
What I need is to check if this data had already been serialized or not before loading it. My goal is to avoid this error and do something else.
Maybe just rescue from the error?