Skip to content

Commit bfdb76b

Browse files
committed
Report output limit succeeded errors
The Leetcode system has a limit on how much output (i.e. to stdout/stderr) a problem submission can produce. If a submission does produce too much output (e.g. due to print statement debugging left in by accident), Leetcode returns an error with `status_code` 13. Currently, the `leetcode--show-submission-result` function does not detect errors with this status code, resulting in an empty `leetcode-result-XXX` buffer and no indication of failure. This change adds detection of the output limit breach and notifies the user in the results buffer that there was a problem. Note that we do not list the problem that was running at the time of the error, since that's probably not relevant to the problem of outputting to stdout et al.
1 parent e53812e commit bfdb76b

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

leetcode.el

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1081,6 +1081,7 @@ STATUS_CODE has following possible value:
10811081
- 10: Accepted
10821082
- 11: Wrong Anwser
10831083
- 12: Memory Limit Exceeded
1084+
- 13: Output Limit Exceeded
10841085
- 14: Time Limit Exceeded
10851086
- 15: Runtime Error. full_runtime_error
10861087
- 20: Compile Error. full_compile_error"
@@ -1112,6 +1113,8 @@ STATUS_CODE has following possible value:
11121113
(insert (format "Status: %s" (leetcode--add-font-lock .status_msg 'leetcode-error-face)))
11131114
(insert (format "\n\n%s / %s testcases passed\n" .total_correct .total_testcases))
11141115
(insert (format "Last Test Case: %s\n" .last_testcase)))
1116+
((eq .status_code 13)
1117+
(insert (format "Status: %s" (leetcode--add-font-lock .status_msg 'leetcode-error-face))))
11151118
((eq .status_code 14)
11161119
(insert (format "Status: %s" (leetcode--add-font-lock .status_msg 'leetcode-error-face)))
11171120
(insert (format "\n\n%s / %s testcases passed\n" .total_correct .total_testcases))

0 commit comments

Comments
 (0)