Skip to content

framework,api,server,ui: improve error messaging#12336

Draft
shwstppr wants to merge 29 commits into
apache:mainfrom
shapeblue:improve-error-messages
Draft

framework,api,server,ui: improve error messaging#12336
shwstppr wants to merge 29 commits into
apache:mainfrom
shapeblue:improve-error-messages

Conversation

@shwstppr

@shwstppr shwstppr commented Dec 24, 2025

Copy link
Copy Markdown
Contributor

Description

Framework level improvements for for contextual and localized API error messages

Design spec: Error Message Consistency, Customization, and Localization Framework

Types of changes

  • Breaking change (fix or feature that would cause existing functionality to change)
  • New feature (non-breaking change which adds functionality)
  • Bug fix (non-breaking change which fixes an issue)
  • Enhancement (improves an existing feature and functionality)
  • Cleanup (Code refactoring and cleanup, that may add test cases)
  • Build/CI
  • Test (unit or integration test code)

Feature/Enhancement Scale or Bug Severity

Feature/Enhancement Scale

  • Major
  • Minor

Bug Severity

  • BLOCKER
  • Critical
  • Major
  • Minor
  • Trivial

Screenshots (if appropriate):

Refined error message with additional context for admin
image

User facing error, with localization
image

Example API response

{
    "deployvirtualmachineresponse": {
        "uuidList": [],
        "errorcode": 535,
        "cserrorcode": 9999,
        "errortext": "Unable to deploy Instance because allocating 1 more Instance would exceed the Account limits. Current: 2, Reserved: 0, Limit: 2. Release unused resources, then retry.",
        "errortextkey": "vm.deploy.resourcelimit.exceeded.account",
        "errormetadata": {
            "resourceRequested": "1",
            "resourceTypeDisplay": "Instance",
            "resourceOwnerType": "Account",
            "resourceAmount": "2",
            "resourceReserved": "0",
            "resourceLimit": "2"
        }
    }
}

How Has This Been Tested?

How did you try to break this feature and the system with this change?

@codecov

codecov Bot commented Dec 24, 2025

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 43.43891% with 375 lines in your changes missing coverage. Please review.
✅ Project coverage is 18.96%. Comparing base (d2c8aa7) to head (02b5fd8).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
.../apache/cloudstack/vm/UnmanagedVMsManagerImpl.java 16.55% 126 Missing ⚠️
...n/java/com/cloud/vm/VirtualMachineManagerImpl.java 13.67% 101 Missing ⚠️
...he/cloudstack/context/ResponseMessageResolver.java 82.32% 17 Missing and 18 partials ⚠️
...n/java/org/apache/cloudstack/error/Exceptions.java 42.85% 31 Missing and 1 partial ⚠️
...ava/org/apache/cloudstack/context/CallContext.java 28.57% 17 Missing and 3 partials ⚠️
.../cloud/resourcelimit/ResourceLimitManagerImpl.java 0.00% 20 Missing ⚠️
...he/cloudstack/api/command/user/vm/DeployVMCmd.java 0.00% 9 Missing ⚠️
...c/main/java/com/cloud/user/AccountManagerImpl.java 50.00% 4 Missing and 3 partials ⚠️
...m/cloud/utils/exception/CloudRuntimeException.java 66.66% 6 Missing ⚠️
...main/java/com/cloud/api/ApiAsyncJobDispatcher.java 0.00% 4 Missing ⚠️
... and 7 more
Additional details and impacted files
@@             Coverage Diff              @@
##               main   #12336      +/-   ##
============================================
+ Coverage     18.93%   18.96%   +0.03%     
- Complexity    18471    18525      +54     
============================================
  Files          6221     6223       +2     
  Lines        560045   560409     +364     
  Branches      68289    68340      +51     
============================================
+ Hits         106048   106288     +240     
- Misses       442372   442470      +98     
- Partials      11625    11651      +26     
Flag Coverage Δ
uitests 3.50% <ø> (+<0.01%) ⬆️
unittests 20.17% <43.43%> (+0.03%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@shwstppr shwstppr force-pushed the improve-error-messages branch from 86379b7 to c938bd1 Compare December 24, 2025 11:55
@shwstppr shwstppr closed this Jan 6, 2026
@shwstppr shwstppr reopened this Jan 6, 2026
@apache apache deleted a comment from blueorangutan Jan 6, 2026
@apache apache deleted a comment from blueorangutan Jan 6, 2026
@apache apache deleted a comment from blueorangutan Jan 6, 2026
@apache apache deleted a comment from blueorangutan Jan 6, 2026
@github-actions

Copy link
Copy Markdown

This pull request has merge conflicts. Dear author, please fix the conflicts and sync your branch with the base branch.

@github-actions

Copy link
Copy Markdown

This pull request has merge conflicts. Dear author, please fix the conflicts and sync your branch with the base branch.

@shwstppr

shwstppr commented Feb 9, 2026

Copy link
Copy Markdown
Contributor Author

@blueorangutan package

@blueorangutan

Copy link
Copy Markdown

@shwstppr a [SL] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress.

@blueorangutan

Copy link
Copy Markdown

Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ el10 ✔️ debian ✔️ suse15. SL-JID 16743

@github-actions

Copy link
Copy Markdown

This pull request has merge conflicts. Dear author, please fix the conflicts and sync your branch with the base branch.

@github-actions

Copy link
Copy Markdown

This pull request has merge conflicts. Dear author, please fix the conflicts and sync your branch with the base branch.

shwstppr added 5 commits June 30, 2026 13:50
Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
@shwstppr

shwstppr commented Jul 1, 2026

Copy link
Copy Markdown
Contributor Author

@blueorangutan package

@blueorangutan

Copy link
Copy Markdown

@shwstppr a [SL] Jenkins job has been kicked to build packages. It will be bundled with no SystemVM templates. I'll keep you posted as I make progress.

@blueorangutan

Copy link
Copy Markdown

Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ el10 ✔️ debian ✔️ suse15. SL-JID 18426

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants