• Iustin Pop's avatar
    Add an Errors module mirroring the Python one · ef3ad027
    Iustin Pop authored
    As described in the module doc string, while writing this it dawned
    upon me that we're mixing all errors together into a single hierarchy
    (well, type on the Haskell side), which is not good. Some errors are
    used purely within noded, some in the CLI frontends, etc. so these
    should not be the same type; frontend functions should only be able to
    raise frontend errors, not backend ones.
    As to this patch itself, I've used again Template Haskell to generate
    both the data type and the serialisation functions, as the initial
    version, hand-written, seemed too prone to errors due to string
    A small unittest for checking serialisation consistency is also added.
    Signed-off-by: default avatarIustin Pop <iustin@google.com>
    Reviewed-by: default avatarGuido Trotter <ultrotter@google.com>