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

Update the application to display the error message in the frontend #35

Merged
merged 1 commit into from
Aug 28, 2023

Conversation

pmalarme
Copy link
Collaborator

Purpose

  • Be sure that if there is an error in the AI Shopping Cart Service, the user can have a meaningful message in the frontend to understand the error
  • Update application properties to always have a message when there is an exception in AI Shopping Cart Service
  • Update the frontend to check when fetch is used if the response is ok or not. If the response is not ok, the status is set to ERROR and the error message is parsed
  • Fix the generation of HTML when recipes is undefined or empty for the top 3 recipes

image

Does this introduce a breaking change?

[ ] Yes
[x] No

Pull Request Type

What kind of change does this Pull Request introduce?

[ ] Bugfix
[x] Feature
[ ] Code style update (formatting, local variables)
[ ] Refactoring (no functional changes, no api changes)
[ ] Documentation content changes
[ ] Other... Please describe:

How to Test

  • Deploy with a wrong Azure OpenAI API Key and check that you have an error message
  • Deploy with a correct Azure OpenAI API Key and check that it is working

It can also be tested locally. Nothing change in the deployment.

git clone [repo-address]
cd [repo-name]
git checkout [branch-name]
  • Run the front-end
cd src/frontend
npm install
npm start
  • Run the AI Shopping Cart Service
cd ../ai-shopping-cart-service
./mvnw clean package
java -jar target/ai-shopping-cart-service-<add-the-version-here>.jar
  • Test the code
  • Check that the error message is there when the backend has wrong Azure OpenAI configuration

What to Check

Verify that the following are valid

  • The application is working if Azure OpenAI settings are correct and if the service is available
  • The application display the error message if the configuration is not correct or the service is not available

Other Information

…an excpetion. Update fetch of the ai shopping cart service API to check the status of the
@pmalarme pmalarme linked an issue Aug 25, 2023 that may be closed by this pull request
@github-actions github-actions bot added src: ai-shopping-cart-service AI Shopping Cart Service - Java Spring Boot microservice src: frontend React Front-end labels Aug 25, 2023
@pmalarme pmalarme added this to the 1.1.0 milestone Aug 25, 2023
Copy link
Collaborator

@aarthiem aarthiem left a comment

Choose a reason for hiding this comment

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

tested and it works. Thanks!

@pmalarme pmalarme merged commit 33f42bf into main Aug 28, 2023
2 checks passed
@pmalarme pmalarme deleted the 32-improve-the-exception-handling branch August 28, 2023 12:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
src: ai-shopping-cart-service AI Shopping Cart Service - Java Spring Boot microservice src: frontend React Front-end
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Improve the exception handling
2 participants