Add workflow failure tips (#2794)
Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com> Co-authored-by: Shuchang Zheng <shu@skyvern.com> Co-authored-by: Shuchang Zheng <wintonzheng0325@gmail.com>
This commit is contained in:
@@ -117,6 +117,26 @@ function WorkflowRun() {
|
||||
</h1>
|
||||
);
|
||||
|
||||
const failureTips: { match: (reason: string) => boolean; tip: string }[] = [
|
||||
{
|
||||
match: (reason) => reason.includes("Invalid master password"),
|
||||
tip: "Tip: If inputting the master password via Docker Compose or in any container environment, make sure to double any dollar signs and do not surround it with quotes.",
|
||||
},
|
||||
// Add more tips as needed
|
||||
];
|
||||
|
||||
const failureReason = workflowRun?.failure_reason;
|
||||
|
||||
const matchedTips = failureReason
|
||||
? failureTips
|
||||
.filter(({ match }) => match(failureReason))
|
||||
.map(({ tip }, index) => (
|
||||
<div key={index} className="text-sm italic text-red-700">
|
||||
{tip}
|
||||
</div>
|
||||
))
|
||||
: null;
|
||||
|
||||
const workflowFailureReason = workflowRun?.failure_reason ? (
|
||||
<div
|
||||
className="space-y-2 rounded-md border border-red-600 p-4"
|
||||
@@ -126,6 +146,7 @@ function WorkflowRun() {
|
||||
>
|
||||
<div className="font-bold">Workflow Failure Reason</div>
|
||||
<div className="text-sm">{workflowRun.failure_reason}</div>
|
||||
{matchedTips}
|
||||
</div>
|
||||
) : null;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user