@@ -71,27 +71,27 @@ instance Exception ParseException where
72prettyPrintParseException :: ParseException -> String
72prettyPrintParseException :: ParseException -> String
73prettyPrintParseException NonScalarKey = "Non scalar key"
73prettyPrintParseException NonScalarKey = "Non scalar key"
74+prettyPrintParseException (UnknownAlias n) =
75+ "Unknown alias: " ++ n
76+prettyPrintParseException (UnexpectedEvent r e) = unlines
77+ [ "Unexpected event:"
78+ , " Received: " ++ maybe "None" show r
79+ , " Expected: " ++ maybe "None" show e
74prettyPrintParseException (InvalidYaml mye) =
81prettyPrintParseException (InvalidYaml mye) =
75 case mye of
82 case mye of
76 Just ye -> "Invalid yaml: " ++ show ye
83 Just ye -> "Invalid yaml: " ++ show ye
77 _ -> "Invalid yaml"
84 _ -> "Invalid yaml"
78prettyPrintParseException (AesonException e) =
85prettyPrintParseException (AesonException e) =
79 "Aeson exception: " ++ e
86 "Aeson exception: " ++ e
80−prettyPrintParseException CyclicIncludes = "Cyclic includes"
81prettyPrintParseException (OtherParseException e) =
87prettyPrintParseException (OtherParseException e) =
82 "Parse exception: " ++ show e
88 "Parse exception: " ++ show e
83−prettyPrintParseException (UnknownAlias n) =
84− "Unknown alias: " ++ n
85−prettyPrintParseException (UnexpectedEvent r e) = unlines
86− [ "Unexpected event:"
87− , " Received: " ++ maybe "None" show r
88− , " Expected: " ++ maybe "None" show e
90prettyPrintParseException (NonStringKeyAlias n v) = unlines
89prettyPrintParseException (NonStringKeyAlias n v) = unlines
91 [ "Non-string key alias:"
90 [ "Non-string key alias:"
92 , " Anchor name: " ++ n
91 , " Anchor name: " ++ n
93 , " Value: " ++ show v
92 , " Value: " ++ show v
94+prettyPrintParseException CyclicIncludes = "Cyclic includes"
96newtype PErrorT m a = PErrorT { runPErrorT :: m (Either ParseException a) }
96newtype PErrorT m a = PErrorT { runPErrorT :: m (Either ParseException a) }
97instance Monad m => Functor (PErrorT m) where
97instance Monad m => Functor (PErrorT m) where