throwOnError :: FromJSON a => Result a -> IO ()
throwOnError res =
  case res of
    Left err -> error $ show err
    Right _  -> return ()
throwOnError :: FromJSON a => Result a -> IO ()
throwOnError res =
  case res of
    Left err -> error $ show err
    Right _  -> return ()
throwOnError res =
  case res of
    Left err -> error $ show err
    Right _  -> return ()