Aman-Mittal commented on issue #252:
URL:
https://github.com/apache/fineract-backoffice-ui/issues/252#issuecomment-5219691281
Closing this — I filed it on a premise that turns out to be wrong, and I
would rather retract it than leave someone chasing a problem that is not there.
The claim was that a failed write tells the user nothing. It does.
`errorInterceptor` (`src/app/core/interceptors/error.interceptor.ts`) is
registered globally in `app.config.ts` and raises a toast carrying the
platform's own message for every failed request:
```ts
if (!req.context.get(SKIP_ERROR_TOAST)) {
notifications.error(messageFor(error, i18n));
}
```
`messageFor` prefers `defaultUserMessage`, and stacks Fineract's `errors[]`
array when there is one. Its unit specs cover exactly that, including the
opt-out (`error.interceptor.spec.ts`, "should handle single developerMessage or
defaultUserMessage" and "should not toast when the SKIP_ERROR_TOAST context is
set"). Nothing under `src/app/features` sets `SKIP_ERROR_TOAST`, so there are
no components opting out of it.
So the 114 `console.error` handlers are redundant logging next to a toast
that already fired — not silent failures. That is minor noise, not worth a
contributor's afternoon.
I also checked the one thing that would still have been a real bug behind
those handlers — a pending `isSaving`/`isLoading` flag set before the request
and cleared only in `next`, which would leave a submit button disabled for good
after one failure. I could not find an instance of it.
What I got wrong: I read the call sites and inferred the behaviour from
them, instead of checking whether something upstream already handled it. The
grep was accurate; the conclusion drawn from it was not.
#223 (a failed list *load* looks like an empty list) is a separate and
still-real problem, and is the better issue to pick up in this area — a toast
that has already faded does not help a user staring at a table that appears to
hold no records.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]