diff --git a/frontend/components/ErrorMessage.js b/frontend/components/ErrorMessage.js index d40bc0bc1..510df2485 100644 --- a/frontend/components/ErrorMessage.js +++ b/frontend/components/ErrorMessage.js @@ -224,6 +224,11 @@ const frame_is_important_heuristic = (frame, frame_index, limited_stacktrace, fr return false } + if (funcname.includes("throw")) return false + + // too sciency + if (frame.inlined) return false + if (params == null) { // no type signature... must be some function call that got optimized away or something special // probably not directly relevant @@ -419,9 +424,11 @@ export const ErrorMessage = ({ msg, stacktrace, cell_id }) => { (frame) => !(ignore_location(frame) && ignore_funccall(frame)) ) + const first_package = get_first_package(limited_stacktrace) + return html`
- Error message + Error message${first_package == null ? null : ` from ${first_package}`}
@@ -470,6 +477,16 @@ export const ErrorMessage = ({ msg, stacktrace, cell_id }) => {
` } +const get_first_package = (limited_stacktrace) => { + for (let [i, frame] of limited_stacktrace.entries()) { + const frame_cell_id = extract_cell_id(frame.file) + if (frame_cell_id) return undefined + + const important = frame_is_important_heuristic(frame, i, limited_stacktrace, frame_cell_id) + if (!important) continue + + if (frame.source_package) return frame.source_package + } const motivational_words = [ // "Don't panic!", diff --git a/frontend/treeview.css b/frontend/treeview.css index 3d63fe432..e4fa55fa8 100644 --- a/frontend/treeview.css +++ b/frontend/treeview.css @@ -296,6 +296,10 @@ jlerror > section > ol > li { jlerror > section > ol > li:not(.important):not(:hover) { opacity: 0.5; } + +jlerror > section > ol > li:not(.important)::marker { + font-weight: 100; +} jlerror > section > ol > li.from_this_notebook { --bg: var(--jl-info-acccolor); background: var(--bg);