@@ -233,6 +233,18 @@ instance A.FromJSON NotYetKnown where
233asVerifiedPackage :: Parse PackageError VerifiedPackage
233asVerifiedPackage :: Parse PackageError VerifiedPackage
234asVerifiedPackage = asPackage asGithubUser
234asVerifiedPackage = asPackage asGithubUser
236+displayPackageError :: PackageError -> Text
237+displayPackageError e = case e of
238+ ErrorInPackageMeta err -> "Error in package metadata: " <> showBowerError err
239+ InvalidVersion -> "Invalid version"
240+ InvalidDeclarationType str -> "Invalid declaration type: \"" <> T.pack str <> "\""
241+ InvalidChildDeclarationType str -> "Invalid child declaration type: \"" <> T.pack str <> "\""
242+ InvalidFixity -> "Invalid fixity"
243+ InvalidKind str -> "Invalid kind: \"" <> T.pack str <> "\""
244+ InvalidDataDeclType str -> "Invalid data declaration type: \"" <> T.pack str <> "\""
236asGithubUser :: Parse e GithubUser
248asGithubUser :: Parse e GithubUser
237asGithubUser = GithubUser <$> asString
249asGithubUser = GithubUser <$> asString