Switched errors in connections and results to use custom error types
Added error message formatting