Skip to content
This repository was archived by the owner on Aug 6, 2025. It is now read-only.

Commit 696afe8

Browse files
authored
Merge pull request #53 from skerschb/varsha804-DOCSP-7636
adding exception for fastly env failure
2 parents 98f0cb9 + 1c4baec commit 696afe8

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

worker/jobTypes/publishDochubJob.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ const workerUtils = require('../utils/utils');
22
const validator = require('validator');
33

44
const invalidJobDef = new Error('job not valid');
5+
const invalidEnvironment = new Error('environment variables missing for jobtype');
56
const FastlyJob = require('../jobTypes/fastlyJob').FastlyJobClass
67

78
//anything that is passed to an exec must be validated or sanitized
@@ -52,6 +53,11 @@ async function runPublishDochub(currentJob) {
5253

5354
workerUtils.logInMongo(currentJob, ' ** Running dochub-fastly migration');
5455

56+
if (process.env.FASTLY_TOKEN === undefined) {
57+
workerUtils.logInMongo(currentJob, 'missing env variable: fastly token');
58+
throw invalidEnvironment;
59+
}
60+
5561
if (
5662
!currentJob ||
5763
!currentJob.payload ||

0 commit comments

Comments
 (0)