Skip to content

Commit

Permalink
Merge pull request #906 from pradnya-orchestral/Enhancement_error_mas…
Browse files Browse the repository at this point in the history
…sage

UI changes for Enhancement of Error Message
  • Loading branch information
m4dcoder authored Aug 13, 2021
2 parents fbdc4dd + c1992e5 commit 79c7eba
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
5 changes: 4 additions & 1 deletion modules/st2-action-reporter/reporters/run-local.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,17 @@ export default function runLocal(execution) {
execution.result && execution.result.stderr ? [
<div key="error" className={style.source}>Error</div>,
<Highlight well lines={20} className={style.highlight} key="error-code" code={execution.result.stderr} type="result" id={execution.id} />,
] : execution.result && execution.result.error ? [
<div key="error" className={style.source}>Error</div>,
<Highlight well lines={20} className={style.highlight} key="error-code" code={execution.result.error} type="result" id={execution.id} />,
] : null,

execution.result && execution.result.traceback ? [
<div key="traceback" className={style.source}>Traceback</div>,
<Highlight well lines={20} className={style.highlight} key="traceback-code" code={[ execution.result.error, execution.result.traceback ].join('\n')} type="result" id={execution.id} />,
] : null,

!execution.result || (!execution.result.stdout && !execution.result.stderr && !execution.result.traceback) ? (
!execution.result || (!execution.result.stdout && !execution.result.stderr && !execution.result.error && !execution.result.traceback) ? (
<Highlight well className={style.highlight} key="none" code="// Action produced no data" type="result" id={execution.id} />
) : null,
];
Expand Down
5 changes: 4 additions & 1 deletion modules/st2-action-reporter/reporters/run-python.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,17 @@ export default function runPython(execution) {
execution.result && execution.result.stderr ? [
<div key="error" className={style.source}>Error</div>,
<Highlight well lines={20} className={style.highlight} key="error-code" code={execution.result.stderr} type="result" id={execution.id} />,
] : execution.result && execution.result.error ? [
<div key="error" className={style.source}>Error</div>,
<Highlight well lines={20} className={style.highlight} key="error-code" code={execution.result.error} type="result" id={execution.id} />,
] : null,

execution.result && execution.result.traceback ? [
<div key="traceback" className={style.source}>Traceback</div>,
<Highlight well lines={20} className={style.highlight} key="traceback-code" code={[ execution.result.error, execution.result.traceback ].join('\n')} type="result" id={execution.id} />,
] : null,

!execution.result || (!execution.result.result && !execution.result.stdout && !execution.result.stderr && !execution.result.traceback) ? (
!execution.result || (!execution.result.result && !execution.result.stdout && !execution.result.stderr && !execution.result.error && !execution.result.traceback) ? (
<Highlight well className={style.highlight} key="none" code="// Action produced no data" />
) : null,
].filter(v => v);
Expand Down
5 changes: 4 additions & 1 deletion modules/st2-action-reporter/reporters/run-remote.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,17 @@ export default function runRemote(execution) {
result && result.stderr ? [
<div key="error" className={style.source}>Error</div>,
<Highlight well lines={20} className={style.highlight} key="error-code" code={result.stderr} type="result" id={execution.id} />,
] :result && result.error ? [
<div key="error" className={style.source}>Error</div>,
<Highlight well lines={20} className={style.highlight} key="error-code" code={result.error} type="result" id={execution.id} />,
] : null,

result && result.traceback ? [
<div key="traceback" className={style.source}>Traceback</div>,
<Highlight well lines={20} className={style.highlight} key="traceback-code" code={[ result.error, result.traceback ].join('\n')} type="result" id={execution.id} />,
] : null,

!result || (!result.result && !result.stderr && !result.stdout && !result.traceback) ? (
!result || (!result.result && !result.stderr && !result.stdout && !result.error && !result.traceback) ? (
<Highlight well className={style.highlight} key="none" code="// Action produced no data" />
) : null,
];
Expand Down

0 comments on commit 79c7eba

Please sign in to comment.