Can you throw an error in the above block so that if either of these are not defined then the app shuts down?