added error haskell type
stubbed out encodeError