-
Notifications
You must be signed in to change notification settings - Fork 178
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
feat(app): ODD add error codes to protocol failed modal #13158
Conversation
Codecov Report
@@ Coverage Diff @@
## edge #13158 +/- ##
==========================================
+ Coverage 72.11% 72.47% +0.36%
==========================================
Files 1531 2359 +828
Lines 50773 64921 +14148
Branches 3144 7225 +4081
==========================================
+ Hits 36614 47051 +10437
- Misses 13650 16124 +2474
- Partials 509 1746 +1237
Flags with carried forward coverage won't be shown. Click here to find out more.
|
@@ -134,3 +131,63 @@ const SCROLL_BAR_STYLE = css` | |||
border-radius: 11px; | |||
} | |||
` | |||
|
|||
const _getHighestPriorityError = (error: RunError): RunError => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
gonna move all of these utils into a shared place in a follow up PR since ill need to use the public function for the desktop app
createdAt: string | ||
detail: string | ||
} | ||
import type { RunError } from '@opentrons/api-client' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can put this line before ModalHeaderBaseProps
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah sorry i think it was after a weird merge, should be fixed now
@@ -44,11 +39,13 @@ export function RunFailedModal({ | |||
const { stopRun } = useStopRunMutation() | |||
const [isCanceling, setIsCanceling] = React.useState(false) | |||
|
|||
if (errors == null) return null | |||
if (errors == null || errors.length === 0) return null |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need to keep errors == null
?
errors type is RunError[] which errors would not get null or undefined?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
right now errors are optional:
interface RunFailedModalProps {
runId: string
setShowRunFailedModal: (showRunFailedModal: boolean) => void
errors?: RunError[]
}
because of what we get back from react query, so this is just to make type checking happy. if we want to get rid of this check then inside of RunSummary
before we render RunFailedModal
we have to make sure runRecord?.data.error
is not null
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested on a DVT and it worked as expected.
Overview
This PR adds an error code to the ODD's protocol failed modal. It does so by recursively looking for the "highest priority" error, which is the error with the lowest status code (preferring non generic status codes).
i.e.
2000
is higher priortity than3000
, but2001
is higher priority than2000
closes RCORE-799
Test Plan
Changelog
Risk assessment
Low