Code Monkey home page Code Monkey logo

Comments (1)

tudiapason avatar tudiapason commented on September 23, 2024

PROBLEM:
When trying to load a nonexisting list, the system displays a technical error message on the Web page.
The purpose of this task is to get a more user-friendly message.

ANALYSIS
My understanding of the code workflow is that:

  1. In the MockDatastoreClient class from todo-service, the BDD response is simulated, so error messages are generated when the list does not exist, for example.
  2. In ToDoService class from todo-service, the different action methods catch the errors and convert them to RuntimeException before sending them to BFF layer.
  3. In MyErrorHandler class from BFF, we handle and format errors before sending them to the front end.
    In the handle method, the system use .toSting() to format the JSON error before sending it that is why we see all the error attributes as type and message displayed on the Web page.

SOLUTION
So I propose reviewing the MyErrorHandler class to extract expected information before sending the error label to the front end. See my change in the following fork:
https://github.com/tudiapason/todo-list-fullstack/tree/main

MANUAL TESTS

  1. FUNCTIONAL TEST:
  • Try to load a nonexistent list: New error message is displayed (See 20230501_MSG_NoSuchList.jpg(
  1. REGRESSION TEST:
  • Try to load the list with the field empty: Previous message still displayed (See 20230501_MSG_NoValuePresent.jpg)

AUTOMATED TESTS
IN PROGRESS

Image
Image

from todo-list-fullstack.

Related Issues (9)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.