Make error handling a little less ugly