Skip to content

Commit 80b94cd

Browse files
committed
better error handling for errors with breakpoints (#break)
1 parent 069ee61 commit 80b94cd

2 files changed

Lines changed: 8 additions & 2 deletions

File tree

‎v3/js/opt-frontend.js‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -188,9 +188,9 @@ $(document).ready(function() {
188188
}
189189

190190
function handleUncaughtExceptionFunc(trace) {
191-
if (trace.length == 1) {
191+
if (trace.length == 1 && trace[0].line) {
192192
var errorLineNo = trace[0].line - 1; /* CodeMirror lines are zero-indexed */
193-
if (errorLineNo !== undefined) {
193+
if (errorLineNo !== undefined && errorLineNo != NaN) {
194194
// highlight the faulting line in pyInputCodeMirror
195195
pyInputCodeMirror.focus();
196196
pyInputCodeMirror.setCursor(errorLineNo, 0);

‎v3/pg_logger.py‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -932,6 +932,12 @@ def create_encoded_stack_entry(cur_frame):
932932
if self.breakpoints:
933933
if not ((lineno in self.breakpoints) or (self.prev_lineno in self.breakpoints)):
934934
append_to_trace = False
935+
936+
# TRICKY -- however, if there's an exception, then ALWAYS
937+
# append it to the trace, so that the error can be displayed
938+
if event_type == 'exception':
939+
append_to_trace = True
940+
935941
self.prev_lineno = lineno
936942

937943
if append_to_trace:

0 commit comments

Comments
 (0)