(status: string)
| 995 | } |
| 996 | |
| 997 | function formatRunStatus(status: string) { |
| 998 | switch (status) { |
| 999 | case "ERROR": |
| 1000 | return "error" |
| 1001 | case "CANCELLED": |
| 1002 | return "cancelled" |
| 1003 | case "EXPIRED": |
| 1004 | return "expired" |
| 1005 | default: |
| 1006 | return status.toLowerCase() |
| 1007 | } |
| 1008 | } |
| 1009 | |
| 1010 | function getErrorMessage(error: unknown) { |
| 1011 | return error instanceof Error ? error.message : String(error) |