Skip to content

Extend deserialisation logic to make it safer #115

@qnikst

Description

@qnikst

At this point if case if we have incorrectly created file we may fail to read it.

For example if we try to check the file generated using ledger state we may get the following error:

Error: "CBOR term deserialisation failed: DeserialiseFailure 1 \"invalid token encoding\""
CallStack (from HasCallStack):
  error, called at src/Control/Monad/Trans/Fail.hs:151:21 in FailT-0.1.2.0-4w6NoUJ7Qgn197ROb6ly0Z:Control.Monad.Trans.Fail
  errorFail, called at src/Cardano/SCLS/Internal/Reader.hs:55:37 in scls-format-0.1.0.0-inplace:Cardano.SCLS.Internal.Reader

It does not seem useful for several reasons:

  1. In case of debug input we need to be able to read the structure even for incorrectly generated file, to be able to debug the problem
  2. It would be nice to propagate error through the functionality calls without falling into errors in the middle of the codebase

Success for this task will be if we can use debug tool to find problems and fix serialization for the real file

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions