diff --git a/src/main/data/middlewares/pipeline.ts b/src/main/data/middlewares/pipeline.ts index 878547e..b63e748 100644 --- a/src/main/data/middlewares/pipeline.ts +++ b/src/main/data/middlewares/pipeline.ts @@ -764,6 +764,7 @@ export function pipelineMiddleware({ getState, dispatch }) { pipelineAPI .fetchStylesheetParameters(job)(webservice) .then((parameters: ScriptOption[] | JobRequestError) => { + error('Result was', parameters) // check if parameters is of type JobRequestError if ('type' in parameters) { dispatch( @@ -774,12 +775,13 @@ export function pipelineMiddleware({ getState, dispatch }) { status: JobStatus.ERROR, }, jobRequestError: parameters, - errors: [ - { - fieldName: 'stylesheet', - error: parameters.description, - }, - ], + // Note : the error can also come from the input + // errors: [ + // { + // fieldName: 'stylesheet', + // error: parameters.description, + // }, + // ], }) ) } else { @@ -828,15 +830,16 @@ export function pipelineMiddleware({ getState, dispatch }) { description: String(e) + ':' + e.parsedText, trace: (e as Error).stack, }, - errors: [ - { - fieldName: 'stylesheet', - error: - e instanceof ParserException - ? e.parsedText - : String(e), - }, - ], + // Note : the error can also come from the input + // errors: [ + // { + // fieldName: 'stylesheet', + // error: + // e instanceof ParserException + // ? e.parsedText + // : String(e), + // }, + // ], }) ) }) diff --git a/src/shared/parser/pipelineXmlConverter/jobToStylesheetParametersXml.ts b/src/shared/parser/pipelineXmlConverter/jobToStylesheetParametersXml.ts index 9517344..16e8183 100644 --- a/src/shared/parser/pipelineXmlConverter/jobToStylesheetParametersXml.ts +++ b/src/shared/parser/pipelineXmlConverter/jobToStylesheetParametersXml.ts @@ -30,7 +30,9 @@ function jobToStylesheetParametersXml(j: Job): string { ${ stylesheet && stylesheet.value ? Array.isArray(stylesheet.value) - ? stylesheet.value.map((v) => ``).join('') + ? stylesheet.value + .map((v) => (v !== '' ? `` : '')) + .join('') : `` : '' }