-
Notifications
You must be signed in to change notification settings - Fork 0
feat: structured task errors across all SDKs #413
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
Merged
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
4fad5c7
docs: specify structured task errors in binding contract
pratyush618 3033a73
feat(python): emit and decode structured task errors
pratyush618 2254fd4
feat(node): emit and decode structured task errors
pratyush618 a8be0a9
feat(java): emit and decode structured task errors
pratyush618 3abfd38
feat(dashboard): render structured task errors
pratyush618 e51369d
fix(node): derive errtype from the runtime class name
pratyush618 0e7614f
fix(java): default missing errtype to Error to match contract
pratyush618 62cfc1b
docs(python): correct JobErrorDetails field-default docstring
pratyush618 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,50 @@ | ||
| import { cn } from "@/lib/cn"; | ||
| import { parseTaskError, taskErrorSummary, taskErrorTooltip } from "@/lib/task-error"; | ||
|
|
||
| /** | ||
| * Full task-error block for detail views. Structured errors get an | ||
| * `errtype: message` headline plus the traceback; legacy strings render | ||
| * verbatim. `className` carries per-site sizing/background (max-h, bg, | ||
| * padding) so each call site keeps its existing look. | ||
| */ | ||
| export function TaskErrorBlock({ error, className }: { error: string; className?: string }) { | ||
| const parsed = parseTaskError(error); | ||
|
|
||
| if (!parsed) { | ||
| return ( | ||
| <pre | ||
| className={cn( | ||
| "overflow-auto whitespace-pre-wrap rounded-md font-mono text-[11px] text-danger", | ||
| className, | ||
| )} | ||
| > | ||
| {error} | ||
| </pre> | ||
| ); | ||
| } | ||
|
|
||
| return ( | ||
| <div className={cn("overflow-auto rounded-md font-mono text-[11px] text-danger", className)}> | ||
| <div className="font-semibold">{taskErrorSummary(parsed)}</div> | ||
| {parsed.traceback.length > 0 ? ( | ||
| <pre className="mt-2 whitespace-pre-wrap">{parsed.traceback.join("\n")}</pre> | ||
| ) : null} | ||
| </div> | ||
| ); | ||
| } | ||
|
|
||
| /** | ||
| * One-line task-error for table cells: structured → `errtype: message` with | ||
| * the traceback tail in the title tooltip; legacy → the raw string with the | ||
| * full text as title (the pre-existing behavior). | ||
| */ | ||
| export function TaskErrorSummary({ error, className }: { error: string; className?: string }) { | ||
| const parsed = parseTaskError(error); | ||
| const text = parsed ? taskErrorSummary(parsed) : error; | ||
| const title = parsed ? taskErrorTooltip(parsed) : error; | ||
| return ( | ||
| <span className={className} title={title}> | ||
| {text} | ||
| </span> | ||
| ); | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.