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

fix: better error handling and some fixes #61

Merged
merged 2 commits into from
Oct 4, 2024

Conversation

kyteinsky
Copy link
Contributor

No description provided.

@kyteinsky kyteinsky requested a review from marcelklehr October 1, 2024 15:13
throw new RuntimeException('Error during request to ExApp (context_chat_backend): ' . $response['error']);
throw new RuntimeException('Error during request to Context Chat Backend (ExApp): ' . $response['error']);
}
if (is_array($response)) {
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
if (is_array($response)) {
if (!is_array($response)) {

?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

app_api only returns an array if there's an array. So if there is no "error" key in the array, this state is unexpected. We only expect a IRequest object.

Copy link
Member

Choose a reason for hiding this comment

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

AH, makes sense

@kyteinsky kyteinsky force-pushed the fix/better-error-handling branch 4 times, most recently from 7e02ada to 495865e Compare October 4, 2024 12:22
Signed-off-by: Anupam Kumar <kyteinsky@gmail.com>
Signed-off-by: Anupam Kumar <kyteinsky@gmail.com>
@kyteinsky kyteinsky force-pushed the fix/better-error-handling branch from 495865e to 53f5681 Compare October 4, 2024 14:20
@kyteinsky kyteinsky merged commit 7aa768d into main Oct 4, 2024
19 checks passed
@kyteinsky kyteinsky deleted the fix/better-error-handling branch October 4, 2024 14:33
@kyteinsky kyteinsky mentioned this pull request Nov 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants