@@ -453,10 +453,25 @@ Return a list of rows, each row is a vector:
453
453
(leetcode--check-submission
454
454
interpret-id slug-title
455
455
(lambda (res )
456
- (let ((answer (aref (alist-get 'code_answer res) 0 )))
456
+ (let ((status-code (alist-get 'status_code res))
457
+ (status-msg (alist-get 'status_msg res)))
457
458
(with-current-buffer res-buf
458
- (insert (concat " Output:\n " answer " \n\n " ))))
459
- (leetcode--loading-mode -1 )))))))))
459
+ (insert " Output:\n " )
460
+ (cond
461
+ ((eq status-code 10 )
462
+ (insert (aref (alist-get 'code_answer res) 0 )))
463
+ ((eq status-code 14 )
464
+ (insert status-msg))
465
+ ((eq status-code 15 )
466
+ (insert status-msg)
467
+ (insert " \n\n " )
468
+ (insert (alist-get 'full_runtime_error res)))
469
+ ((eq status-code 20 )
470
+ (insert status-msg)
471
+ (insert " \n\n " )
472
+ (insert (alist-get 'full_compile_error res))))
473
+ (insert " \n\n " )
474
+ (leetcode--loading-mode -1 )))))))))))
460
475
461
476
(defun leetcode--check-submission (submission-id slug-title cb )
462
477
" Polling to check submission detail.
@@ -477,7 +492,12 @@ request success."
477
492
(lambda (&key data &allow-other-keys )
478
493
(if (equal (alist-get 'state data) " SUCCESS" )
479
494
(funcall cb data)
480
- (leetcode--check-submission submission-id slug-title cb))))))
495
+ (leetcode--check-submission submission-id slug-title cb))))
496
+ :error
497
+ (cl-function
498
+ (lambda (&rest args &key error-thrown &allow-other-keys )
499
+ (leetcode-global-loading-mode -1 )
500
+ (message " LeetCode Login ERROR: %S " error-thrown)))))
481
501
482
502
(defun leetcode--solving-layout ()
483
503
" Specify layout for solving problem.
0 commit comments