Untitled

mail@pastecode.io avatar
unknown
javascript
a year ago
537 B
5
Indexable
Never
try {
    let ok = await executeCode(req, res, next);
    console.log(ok)
    if(ok == false) throw e;
}
catch(e) {
    console.log(e);
    await Submission.create({
        submitterUserName: username,
        problemID: problemID,
        language: language,
        code: code,
        verdict: "Incorrect answer on test case " + (i+1).toString(),
        runTime: 1000
    })
    return res.status(404).json({
        result: "fail",
        message: "incorrect answer on test case " + (i+1).toString(),
    })

}