haskell / security-advisories

https://haskell.github.io/security-advisories/
Other
46 stars 18 forks source link

add `Exception` instance to to `ParseAdvisoryError` #200

Closed MangoIV closed 5 months ago

MangoIV commented 5 months ago

Summary

I would like to use the displayException function such that I do not have to reimplement this

169   │         case e of
170   │           MarkdownError _ explanation -> "Markdown parsing error:\n" <> explanation
171   │           MarkdownFormatError explanation -> "Markdown structure error:\n" <> explanation
172   │           TomlError _ explanation -> "Couldn't parse front matter as TOML:\n" <> explanation
173   │           AdvisoryError _ explanation -> "Advisory structure error:\n" <> explanation

I wonder whether you could add a default instance for Exception where you override displayException to do what the code in hsec-tools/app/Main.hs does.

Thanks in advance!