Refactors the error handling to remove some duplication

This commit is contained in:
Michael Daffin 2019-08-10 13:49:12 +01:00
commit b37c392fa7