Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error message title #3041

Merged
merged 2 commits into from
Oct 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 18 additions & 1 deletion frontend/components/ErrorMessage.js
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,11 @@
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
Expand Down Expand Up @@ -419,9 +424,11 @@
(frame) => !(ignore_location(frame) && ignore_funccall(frame))
)

const first_package = get_first_package(limited_stacktrace)

return html`<jlerror>
<div class="error-header">
<secret-h1>Error message</secret-h1>
<secret-h1>Error message${first_package == null ? null : ` from ${first_package}`}</secret-h1>
<!-- <p>This message was included with the error:</p> -->
</div>

Expand Down Expand Up @@ -470,6 +477,16 @@
</jlerror>`
}

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!",
Expand Down Expand Up @@ -541,3 +558,3 @@
}
return erred_upstreams
}
4 changes: 4 additions & 0 deletions frontend/treeview.css
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
Loading