Ensure errors reach sentry

most of these changes are from branch "refactor" so once that is merged, the diffs will be easier to see (and are only about 5 lines).