Better error handling & coverage around errors

still a WIP