Skip to content

fix(serverless): show why a deploy was refused for credit - #142

Open
Ryank90 wants to merge 1 commit into
rc/serverlessfrom
fix/serverless-credit-refusal
Open

Ryank90 wants to merge 1 commit into
rc/serverlessfrom
fix/serverless-credit-refusal

Conversation

@Ryank90

@Ryank90 Ryank90 commented Sep 25, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Decode a 402 shortfall as a money amount (amount and currency) instead of a string, so a refused deploy no longer fails with a JSON unmarshal error.
  • Print the API detail, which says whether credit cannot cover the request or the account is suspended, plus the shortfall to add before retrying.

Test plan

  • go test -race ./internal/api/serverless/
  • make lint
  • With a negative balance, runware serverless deploy reports the credit detail and shortfall instead of cannot unmarshal object into Go struct field ProblemDetails.shortfall
  • With a suspended account, the same command reports that credit is suspended

A 402 shortfall is a money object, so create app failed to decode the problem and hid whether the balance was short or the account was suspended.
@coderabbitai

coderabbitai Bot commented Sep 25, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. To trigger a review, include coderabbit-review in the PR description. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Advanced

Run ID: c56b804b-5eb0-4e15-b498-849253686d01

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

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

Successfully merging this pull request may close these issues.

1 participant