waves icon indicating copy to clipboard operation
waves copied to clipboard

Allow the frontend to react to loan-request validation errors

Open thomaseizinger opened this issue 4 years ago • 0 comments

As outlined in #229, we want better error reporting between bobtimus and the frontend.

This issue tracks specifically the validation of the LoanRequest.

Validation can fail in variety of ways. In order to return meaningful errors, we need to first work out, what exactly we want to display on the frontend.

As a guideline, I would suggest to define only one RFC7807 error that we return here which is specific to LoanRequest validation opposed to defining one RFC7807 per validation failure cause.

As part of this problem, we can return additional fields (the RFC calls it "extension members") that for example list the individual form fields that were problematic. The frontend can then react to this error, find the relevant form field and display the error message from the backend to the user.

Having only on problem type instead of multiple should simplify the implementation on the frontend.


Originally posted by @bonomat in https://github.com/comit-network/waves/issues/229#issuecomment-899116992:

some failure cases:

  • if an invalid principal amount was sent to bobtimus, the frontend gets back an http 500 without any details. LoanRequest validation errors should be forwarded to the frontend.

thomaseizinger avatar Aug 16 '21 01:08 thomaseizinger