Skip to content

[SPIKE] - UIs: display filing error messages from API instead of generic error dialog #32561

Closed

Description

@severinbeauvais

Presently, if there's a filing error due to invalid data (eg, director address), the UI displays a generic error dialog.

Instead, we should display the actual error description from the API response so that the user can know which invalid data to fix.

In the past, we displayed some API errors in the dialog. This may have been broken by the improved error reporting in the API response (ie, which the UIs have not been updated to handle). This may be an easy fix. The fix would have to be done in all UIs that submit filings:

  • Create UI
  • Edit UI
  • Filings UI

FYI: @Mihai-QuickSilverDev @mstanton1 @dylan644

Activity

  1. added
    Entities Team
    on Feb 23, 2026
  2. severinbeauvais commented on Feb 23, 2026

    @severinbeauvais
    CollaboratorAuthor

    Analysis

    Generally, the API provide a list of error messages for invalid filing elements, eg:

    image.png

    The error dialog could display these as follows:

    image.png

    or maybe like this:

    image.png

    Unfortunately, the error path is a very specific path in the filing JSON that is useful for trouble-shooting but it's not very user-friendly.

  3. mstanton1 commented on Feb 23, 2026

    @mstanton1
    Collaborator

    @severinbeauvais I'm not familiar with any of our other apps including the error path in the UI. With error logs I'd expect that if we needed to look at the path we'd find it there. Can we shift to that approach?

    @janisrogers can you review to provide feedback on the error enhancement here. Typically we would want to have in form feedback rather than at the time of submission, but if something isn't caught in the form this seems valuable. I can create a design ticket if that's helpful?

  4. severinbeauvais commented on Feb 23, 2026

    @severinbeauvais
    CollaboratorAuthor

    @janisrogers Any thoughts on how we could display the API response errors?

  5. severinbeauvais commented on Feb 23, 2026

    @severinbeauvais
    CollaboratorAuthor

    @severinbeauvais I'm not familiar with any of our other apps including the error path in the UI. With error logs I'd expect that if we needed to look at the path we'd find it there. Can we shift to that approach?

    You're right, we don't display the error path in the UI but it looked weird to me to have 2 messages saying "Postal code is required".

    We already display the error object in the developer console but one has to drill down a bit to get any details (see below). It might make sense to display the errors in a cleaner fashion.

    Expanded error object in develop console:
    image.png

  6. severinbeauvais commented on Feb 23, 2026

    @severinbeauvais
    CollaboratorAuthor

    Example of improved error reporting (not "logging" because it's only on the user's computer):

    image.png

  7. janisrogers commented on Feb 24, 2026

    @janisrogers
    Collaborator

    Wouldn't these errors show on form validation?

  8. severinbeauvais commented on Feb 24, 2026

    @severinbeauvais
    CollaboratorAuthor

    Wouldn't these errors show on form validation?

    Only if the user used to form to edit the data... If, for example, they tried to file an Annual Report and didn't touch the directors but the directors had invalid addresses then no form validation came into play; they would see filing errors instead. (This is a recent and non-unique Prod scenario.)

  9. janisrogers commented on Feb 24, 2026

    @janisrogers
    Collaborator

    Don't we have something (I think it shows an error under the fee calculator)that says "unresolved errors" or something like that, and then shows the errors where the information is missing?

  10. severinbeauvais commented on Feb 24, 2026

    @severinbeauvais
    CollaboratorAuthor

    Don't we have something (I think it shows an error under the fee calculator)that says "unresolved errors" or something like that, and then shows the errors where the information is missing?

    That's only if the UI knows there are errors (ie, form validation) (and only for some filings).

    In the recent scenario, the UI did not detect any errors because the invalid data was not edited via a form.

    Janis, if you're suggesting that the UI interpret the API response errors and show the user, on-screen, where the error is, I like that a lot but would be a lot of work.

    For example, the UI could look at the error path and identify which filing element is invalid, then cause that element to be invalid on-screen. However, a mapping for every filing type to every possible element path would be a lot of work.

    I don't want to give up on this because it's a lot of work. I'm hoping we can find a simpler (albeit less ideal) solution. For instance, what if we mapped the error path to something more user-friendly? Eg, "One of your parties has an invalid postal code. Please edit that party to correct the issue."

  11. changed the title [-]UIs: display filing error messages from API instead of generic error dialog[/-] [+][SPIKE} - UIs: display filing error messages from API instead of generic error dialog[/+] on Feb 24, 2026
  12. changed the title [-][SPIKE} - UIs: display filing error messages from API instead of generic error dialog[/-] [+][SPIKE] - UIs: display filing error messages from API instead of generic error dialog[/+] on Feb 24, 2026
  13. severinbeauvais commented on Feb 24, 2026

    @severinbeauvais
    CollaboratorAuthor

    PS Do you remember the old, ugly schema error dialog? The API now provides a much better response (for the benefit of API users). Here's what that could look like in the UI. Personally, I love this because it tells me the error and identifies the invalid data element.

    image.png

  14. Mihai-QuickSilverDev commented on Feb 25, 2026

    @Mihai-QuickSilverDev
    Collaborator

    Scope of this work:

    • For every filing stopping error, not stopped by the filing itself, we need to inform the user in English language.
    • Message needs to contain both what is causing the error, and also what next step(s) should be for the user.
    • Ideally maybe errors could be coded and mapped in a translation table.
    • Source of these errors:
    • Annual Report filing
    • Director data is displayed, but is not editable
    • AR filing cannot be filed
    • Front End does not catch anything
    • Back End catches error
    • Message on screen:
    • "YOUR FILING CANNOT BE FILED AS SUBMITTED. ONE OF YOUR DIRECTORS' ADDRESSES CONTAINS A TRAILING SPACE IN THE CITY FIELD. PLEASE CORRECT THAT DATA AND RESUBMIT THIS FILLING AGAIN.
    • With hundreds of thousands of users scheduled to join the modernization system ahead, this is going to be a lifeline for the Ops support area.
  15. 3 remaining items

  16. severinbeauvais commented on Feb 25, 2026

    @severinbeauvais
    CollaboratorAuthor

    Analysis and Options

    This ticket started with the idea of fixing the display of errors from the API. This was broken when we started using the API Gateway, which reformatted the error response. This is still an easy fix for all affected UIs and we should do it at a minimum.

    However, it was found that the error messages from the API usually don't provide enough information for a user to know what to fix. For example, an error message might identify an issue with a postal code but doesn't identify for what address record. That information is available in a "path" but is not user-friendly, although an operations person would likely understand it.

    There was a proposal that we "log" errors, or possibly report them in full detail in the developer console. This, too, is not user-friendly, but an operations person could talk a user through finding the errors and then identifying their cause.

    There was a question about showing the errors during form validation, which doesn't apply here because the user bypassed the form (existing data was not edited). Note that the root cause here is invalid existing data.

    There was an idea to interpret the errors and show the user the invalid field on-screen (ie, in a form). This would be fairly complex to implement, and possibly impossible for uneditable/readonly records.

    There was a proposal to "auto-fix" known errors. This would be possible from the UI (before submission) or the API (after submission), but it raises the question of whether we're allowed to modify user data. We would also need to expand this code every time we found new fixable errors.

    The final several ideas are basically to improve the current error reporting by specifically identifying the error (and its subject record) and providing some guidance on how the user can fix it. This would be faily complex due to the sheer number of possible errors (eg, every field in every filing), although with medium effort we could do the first part and we could show a generic "how to correct" message.

    And this takes me back to the root cause: invalid existing data. Perhaps it would be a better idea to pre-emptively fix that data before the user is hung up by it in a (possibly unrelated) filing.

    Where do we want to go from here?

  17. severinbeauvais commented on Feb 25, 2026

    @severinbeauvais
    CollaboratorAuthor

    I have provided some example screenshots, above, on how we could improve the display of existing errors. I will pursue this for another day or so as I think the result might be worthwhile, but please let me know your ideas and suggestions.

    @mstanton1 @forgeuxGH5 @janisrogers

  18. severinbeauvais commented on Feb 25, 2026

    @severinbeauvais
    CollaboratorAuthor

    I created a POC for improved error messages. It only handles Incorporation Applications at the moment but is easily extensible. There are still some "future" things to improve. The PR with the code changes is bcgov/business-create-ui#841. Here are some examples. (Of course, the dialog wording can be changed.)

    Sample mailing address error:
    mailing address error.png

    Sample fallback for data error (eg, unknown path):
    mailing address path not found error.png

    Sample schema error:
    name translations schema error.png

    Sample fallback for schema error (eg, object error):
    name translations object error.png

  19. added
    UX
    on Feb 26, 2026
  20. mstanton1 commented on Feb 26, 2026

    @mstanton1
    Collaborator

    Meeting scheduled Wednesday Mar 4th to review spike and create tickets for grooming. This will include dev, design and BA. As the spike is completed, this could be moved to done.

  21. severinbeauvais commented on Feb 26, 2026

    @severinbeauvais
    CollaboratorAuthor

    To Discuss

    • do we want to simply show the error messages from the API, same as before? (low effort) - No
    • do we want to show raw error paths + messages (per earlier screenshots above)? (low effort) - No
    • do we want to show translated error paths + messages (per later screenshots above)? (medium+ effort) - Yes
    • do we want to add any text to this dialog box? (note that BC Registries contact info already displays for non-staff users) - No, for MVP release of this we will leave the dialog box as is. Design enhancements to be tackled in later phase.
    • do we want to log error messages directly to console? (low effort) - Yes
    • do we want other tickets to investigate on-screen error styling? (complex / impossible for readonly data). Idea was to take the user back to the error and point them to it - Not for this phase. Once we onboard users we can obtain metrics on the errors received and handle those in the UI.
    • do we want other tickets to investigate data auto-fixing in UI or API? (medium effort) - Later phase. We can't change 'data' but can do things like clear leading zeros etc. Hopefully import will clean up somewhat.
    • do we want other tickets to investigate data fixing during import? (may partly exist) - **This is important work but will be tackled by Mikaela's team.
    • anything else...**
  22. Mihai-QuickSilverDev commented on Feb 26, 2026

    @Mihai-QuickSilverDev
    Collaborator
    • I think that we need to set the time/cost on the side for a second, when having this discussion.
    • Having a half backed solution for this issue is going to be worse than do nothing. It would create one of these side projects that would sink our focus and energy.
    • I would have UI/UX create for us a standard of interacting with the client on the screen when File and Pay fails.
    • A standard message box on the screen. In this box a message will be displayed from a mapping table.
    • We have one UI ticket to display the standard error box.
    • Then we build that mapping table at our own pace.
    • Every error we encounter, either at Front End or Back End, we run a lookup in the mapping table, cosmeticized user facing message is retrieved and displayed on screen.
    • Leading the way will be Data Migration known data issues, in order of number of occurrences.
    • This will be an ongoing self improving solution, with minimum cost, and no derailments on the Critical Path.
    • Example:
      • We know that there is migrated data where directors addresses are missing postal codes, whereas the postal code should be in place.
      • We test and determine the impact: Alteration, Correction, Annual Report, Director Change.
      • We add the entries in the mapping table.
      • Next time an Annual Report fails because one of the directors address is missing a mandatory postal code, the screen will display the nice text box with customized message: "One of your directors' addresses is missing a mandatory postal code. Please correct this error and try again this filing!"
  23. severinbeauvais commented on Feb 26, 2026

    @severinbeauvais
    CollaboratorAuthor

    A "mapping table" is essentially what I implemented in my proof of concept. It translates the "error path" to a user-facing message reporting where the error is.

  24. severinbeauvais commented on Mar 3, 2026

    @severinbeauvais
    CollaboratorAuthor

    This spike is complete but the code changes have not been merged into main branch. They are still here: bcgov/business-create-ui#841

  25. mstanton1 commented on Mar 5, 2026

    @mstanton1
    Collaborator

    Added answers to discussion items in line, above. Thanks @severinbeauvais

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Entities TeamUX

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions