You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[SPIKE] - UIs: display filing error messages from API instead of generic error dialog #32561
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:
@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?
@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.
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.)
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?
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."
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
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
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.
"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.
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.
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.
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:
Sample fallback for data error (eg, unknown path):
Sample schema error:
Sample fallback for schema error (eg, object error):
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.
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.
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!"
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.
Activity
severinbeauvais commentedon Feb 23, 2026
Analysis
Generally, the API provide a list of error messages for invalid filing elements, eg:
The error dialog could display these as follows:
or maybe like this:
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.
mstanton1 commentedon Feb 23, 2026
@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?
severinbeauvais commentedon Feb 23, 2026
@janisrogers Any thoughts on how we could display the API response errors?
severinbeauvais commentedon Feb 23, 2026
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:

severinbeauvais commentedon Feb 23, 2026
Example of improved error reporting (not "logging" because it's only on the user's computer):
janisrogers commentedon Feb 24, 2026
Wouldn't these errors show on form validation?
severinbeauvais commentedon Feb 24, 2026
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.)
janisrogers commentedon Feb 24, 2026
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?
severinbeauvais commentedon Feb 24, 2026
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."
[-]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[/+][-][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[/+]severinbeauvais commentedon Feb 24, 2026
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.
Mihai-QuickSilverDev commentedon Feb 25, 2026
Scope of this work:
Example:
3 remaining items
severinbeauvais commentedon Feb 25, 2026
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?
severinbeauvais commentedon Feb 25, 2026
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
severinbeauvais commentedon Feb 25, 2026
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:

Sample fallback for data error (eg, unknown path):

Sample schema error:

Sample fallback for schema error (eg, object error):

mstanton1 commentedon Feb 26, 2026
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.
severinbeauvais commentedon Feb 26, 2026
To Discuss
Mihai-QuickSilverDev commentedon Feb 26, 2026
severinbeauvais commentedon Feb 26, 2026
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.
severinbeauvais commentedon Mar 3, 2026
This spike is complete but the code changes have not been merged into main branch. They are still here: bcgov/business-create-ui#841
mstanton1 commentedon Mar 5, 2026
Added answers to discussion items in line, above. Thanks @severinbeauvais