Skip to content

Commit

Permalink
fix: hide temp path on error message
Browse files Browse the repository at this point in the history
  • Loading branch information
seo-rii committed Dec 31, 2021
1 parent af32d51 commit d747870
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/runner/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import {
executeJudge,
clearTempEnv,
ExecuteResult,
getTmpPath,
} from './util'

export default function commonJudge(
Expand Down Expand Up @@ -46,7 +47,9 @@ export default function commonJudge(
reason: 'CE',
time: 0,
memory: 0,
message: buildResult.stderr,
message: buildResult.stderr
.replaceAll(getTmpPath(data.uid), '~')
.replaceAll(`/p-${data.uid}`, ''),
})
return
}
Expand Down Expand Up @@ -77,7 +80,7 @@ export default function commonJudge(
judgeResult = 'TLE' as JudgeResultCode
}
if (!message)
message = errorMsg.replaceAll(`/tmp/${data.uid}`, '~')
message = errorMsg.replaceAll(getTmpPath(data.uid), '~')
} else {
let info = '',
err = stderr.split('\n')
Expand Down

0 comments on commit d747870

Please sign in to comment.