Throw error if there is a problem with environment