Skip to content

Commit

Permalink
fix(log): fixed parsing log for different runtime
Browse files Browse the repository at this point in the history
  • Loading branch information
YuryShkoda committed Apr 11, 2023
1 parent 7b12591 commit 3b1e4a1
Showing 1 changed file with 14 additions and 9 deletions.
23 changes: 14 additions & 9 deletions web/src/containers/Studio/internal/hooks/useEditor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -170,18 +170,23 @@ const useEditor = ({
runTime: selectedRunTime
})
.then((res: any) => {
const { errors, warnings, logLines } = parseErrorsAndWarnings(
res.data.split(SASJS_LOGS_SEPARATOR)[1]
)

const log: LogObject = {
body: logLines.join(`\n`),
errors,
warnings
if (selectedRunTime === RunTimeType.SAS) {
const { errors, warnings, logLines } = parseErrorsAndWarnings(
res.data.split(SASJS_LOGS_SEPARATOR)[1]
)

const log: LogObject = {
body: logLines.join(`\n`),
errors,
warnings
}

setLog(log)
} else {
setLog(res.data.split(SASJS_LOGS_SEPARATOR)[1] ?? '')
}

setWebout(res.data.split(SASJS_LOGS_SEPARATOR)[0] ?? '')
setLog(log)
setTab('log')

// Scroll to bottom of log
Expand Down

0 comments on commit 3b1e4a1

Please sign in to comment.