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

Simplify tool error handling #1168

Merged
merged 3 commits into from
May 28, 2024
Merged

Simplify tool error handling #1168

merged 3 commits into from
May 28, 2024

Conversation

Saghen
Copy link
Collaborator

@Saghen Saghen commented May 24, 2024

Continues #1163 by having tools simplify throw errors rather than returning an explicit error or success status. Also introduced a util for stringifying unknown errors so we'll hopefully find less [Object object] errors downstream from libraries which don't use the native Error object

@Saghen Saghen requested review from mishig25 and nsarrazin May 24, 2024 17:49
@Saghen Saghen self-assigned this May 24, 2024
@nsarrazin nsarrazin added enhancement New feature or request tools labels May 27, 2024
@mishig25
Copy link
Collaborator

mishig25 commented May 27, 2024

the CI is red. For example, these lines

import { ToolResultStatus } from "$lib/types/Tool";
import { ToolResultStatus } from "$lib/types/Tool";
is no longer needed

@mishig25
Copy link
Collaborator

mishig25 commented May 27, 2024

looks great! Like the new design of throwing errors rather than using rust-like error enums values (looks more javascript-y now)

@mishig25
Copy link
Collaborator

there is a merge conflict, afterwards LGTM !

@mishig25 mishig25 force-pushed the feat/tool-error-handling branch from 3f9aee0 to 1e75fd8 Compare May 28, 2024 08:44
Copy link
Collaborator

@mishig25 mishig25 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed the merge conflicts. LGTM! Merging it.

simulated a prod error (testing)

on main
Screenshot 2024-05-28 at 10 45 18

on this branch
Screenshot 2024-05-28 at 10 43 16

one small follow-up PR we can do is: like #1188, we can improve the UI when there is an error (as an example, like red background color on error msg etc. cc: @gary149)

@mishig25 mishig25 merged commit d409c95 into main May 28, 2024
3 checks passed
@mishig25 mishig25 deleted the feat/tool-error-handling branch May 28, 2024 08:52
ice91 pushed a commit to ice91/chat-ui that referenced this pull request Oct 30, 2024
* feat: simplify tool error handling

* feat: resolve linting and type errors

---------

Co-authored-by: Mishig <mishig.davaadorj@coloradocollege.edu>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request tools
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants