Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[AIP-193] Allow Dynamic Variable Placeholders in Error Message #1302

Open
yordis opened this issue Feb 3, 2024 · 0 comments
Open

[AIP-193] Allow Dynamic Variable Placeholders in Error Message #1302

yordis opened this issue Feb 3, 2024 · 0 comments

Comments

@yordis
Copy link

yordis commented Feb 3, 2024

As a programmer, I would like to define a placeholder in the error message to have static error messages with Dynamic Variables capabilities.

Example:

{
  "error": {
    "code": 429,
    "message": "The zone '{zone}' does not have enough resources available to fulfill the request. Try a different zone, or try again later.",
    "status": "RESOURCE_EXHAUSTED",
    "details": [
      {
        "@type": "type.googleapis.com/google.rpc.ErrorInfo",
        "reason": "RESOURCE_AVAILABILITY",
        "domain": "compute.googleapis.com",
        "metadata": {
          "zone": "us-east1-a",
          "vmType": "e2-medium",
          "attachment": "local-ssd=3,nvidia-t4=2",
          "zonesWithCapacity": "us-central1-f,us-central1-c"
        }
      }
    ]
  }
}

Rationale

Take #1110 as an example of an error-rune situation; it could be just a simple mistake or an honest mistake we make more often than it needs to happen.
In the worst case, the developer used a different value format between the metadata value and the message dynamic section.

Promoting dynamic variable placeholder allows "static" error messages, which are much easier to deal with, without losing the capability of getting a final Displayable Error Message that tools could decide to print with the replaced values.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant