Skip to content

Commit

Permalink
fix bogus rison error
Browse files Browse the repository at this point in the history
  • Loading branch information
tsullivan committed Mar 13, 2020
1 parent 4dbe261 commit 868b9b9
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -82,16 +82,21 @@ export function registerGenerateFromJobParams(
}

const { exportType } = request.params;
let jobParams;
let response;
try {
const jobParams = rison.decode(jobParamsRison) as object | null;
jobParams = rison.decode(jobParamsRison) as object | null;
if (!jobParams) {
throw new Error('missing jobParams!');
}
response = await handler(exportType, jobParams, legacyRequest, h);
} catch (err) {
throw boom.badRequest(`invalid rison: ${jobParamsRison}`);
}
try {
response = await handler(exportType, jobParams, legacyRequest, h);
} catch (err) {
throw handleError(exportType, err);
}
return response;
},
});
Expand Down

0 comments on commit 868b9b9

Please sign in to comment.