paupino / psqlpack

A logical database management system for PostgreSQL enabling incremental database deployment.
Apache License 2.0
8 stars 2 forks source link

Move error formatting into error definition. #48

Closed justinlatimer closed 7 years ago

justinlatimer commented 7 years ago

error-chain errors implement Display and Debug and includes some really easy ways to generate formatted descriptions of errors (including errors back up the chain).

I've moved the error display logic into the error definitions so we can take advantages of this, simplifying some of the code as I went. Defining the custom formats is a bit verbose, requiring a newtype etc, there is probably a better place to put it, which I'm thinking about.