It seems like this try/catch could be generalized and placed into `primary.js`