-
-
Notifications
You must be signed in to change notification settings - Fork 934
feat(errors): PRO-UX.1 + PRO-UX.2 — Pro CLI error UX bridge + root-cause fix #775
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
Merged
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
c22ea06
feat(errors): pro-error-registry extending defaultErrorRegistry [Stor…
rafaelscosta e860d56
feat(pro-cli): envelope bridge + warm render + OS-aware recovery [Sto…
rafaelscosta d9c8966
fix(installer): parse nested error envelope in pro-setup _request [St…
rafaelscosta 6b1fdb3
chore(ids): register pro-error-registry in entity registry [Story PRO…
rafaelscosta 6aa9233
chore(ids): regen entity-registry deterministically [Story PRO-UX.1]
rafaelscosta 2df2f83
fix(pro-cli): null/non-object guards in renderError + pro-setup fallb…
rafaelscosta File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,83 @@ | ||
| // PRO-UX.1 / PRO-UX.2 — Pro-specific error registry for the AIOX Pro CLI. | ||
| // Extends the canonical error-governance infra (EPIC-AIOX-ERROR-GOVERNANCE): | ||
| // reuses AIOXError + ErrorRegistry, maps to EXISTING ErrorCategory values | ||
| // (no new categories — constants.js is Object.freeze), and mirrors the | ||
| // license-server ErrorCodes (no AIOX_ prefix — deliberate, validated by the | ||
| // /^[A-Z0-9_]+$/ regex in ErrorRegistry._normalizeDefinition). | ||
| // | ||
| // userMessage holds the warm G3-approved PT-BR copy (fallback when the server | ||
| // envelope omits message_pt). recovery holds actionable PT-BR steps. | ||
|
|
||
| const { ErrorRegistry } = require('./error-registry'); | ||
| const { ErrorCategory, ErrorSeverity } = require('./constants'); | ||
|
|
||
| const PRO_ERROR_DEFINITIONS = Object.freeze([ | ||
| { | ||
| code: 'SEAT_LIMIT_EXCEEDED', | ||
| category: ErrorCategory.PERMISSION, // license-server "auth says no" → permission | ||
| severity: ErrorSeverity.ERROR, | ||
| retryable: false, | ||
| exitCode: 13, | ||
| userMessage: | ||
| 'Opa! Você já está usando o Pro no número máximo de máquinas. Pega o código de suporte aqui embaixo e fala com a gente que a gente libera rapidinho.', | ||
| recovery: [ | ||
| 'Pega o código de suporte abaixo', | ||
| 'Cola no chat com o suporte', | ||
| 'Depois que liberarem, roda o comando de instalação de novo', | ||
| ], | ||
| }, | ||
| { | ||
| code: 'NOT_A_BUYER', | ||
| category: ErrorCategory.PERMISSION, | ||
| severity: ErrorSeverity.ERROR, | ||
| retryable: false, | ||
| exitCode: 13, | ||
| userMessage: | ||
| 'Hmm, sua licença Pro não está ativa no momento. Pega o código de suporte aqui embaixo e fala com a gente que resolvemos rapidinho.', | ||
| recovery: [ | ||
| 'Pega o código de suporte abaixo', | ||
| 'Cola no chat com o suporte', | ||
| 'Aguarda a verificação da sua compra', | ||
| ], | ||
| }, | ||
| { | ||
| code: 'REVOKED_KEY', | ||
| category: ErrorCategory.PERMISSION, | ||
| severity: ErrorSeverity.ERROR, | ||
| retryable: false, | ||
| exitCode: 13, | ||
| userMessage: | ||
| 'Hmm, sua licença Pro não está ativa no momento. Pega o código de suporte aqui embaixo e fala com a gente que a gente verifica pra você.', | ||
| recovery: [ | ||
| 'Pega o código de suporte abaixo', | ||
| 'Cola no chat com o suporte', | ||
| 'Aguarda o retorno do financeiro', | ||
| ], | ||
| }, | ||
| { | ||
| code: 'RATE_LIMITED', | ||
| category: ErrorCategory.NETWORK, // throttling → network layer | ||
| severity: ErrorSeverity.WARNING, | ||
| retryable: true, | ||
| userMessage: | ||
| 'Calma! Foram muitas tentativas em pouco tempo. Espera uns minutinhos e tenta de novo.', | ||
| recovery: ['Aguarda 5 minutos', 'Tenta o comando de novo'], | ||
| }, | ||
| { | ||
| code: 'PRO_ARTIFACT_UNAVAILABLE', | ||
| category: ErrorCategory.EXTERNAL_EXECUTOR, // npm/tarball fetch → external executor | ||
| severity: ErrorSeverity.ERROR, | ||
| retryable: true, | ||
| userMessage: | ||
| 'Tivemos um probleminha pra baixar o componente Pro. Limpa o cache e tenta de novo em alguns minutos que deve rolar.', | ||
| recovery: [ | ||
| 'Aguarda 5 minutos (o servidor pode estar reiniciando)', | ||
| 'Roda `aiox install --recover-cache` para limpar o cache local', | ||
| 'Tenta de novo', | ||
| ], | ||
| }, | ||
| ]); | ||
|
|
||
| const proErrorRegistry = new ErrorRegistry(PRO_ERROR_DEFINITIONS); | ||
|
|
||
| module.exports = { proErrorRegistry, PRO_ERROR_DEFINITIONS }; | ||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion | 🟠 Major | ⚡ Quick win
Use absolute imports for core error modules.
Please switch these
require('./...')statements to the project’s absolute import form to align with repository standards.As per coding guidelines,
**/*.{js,jsx,ts,tsx}: Use absolute imports instead of relative imports in all code.🤖 Prompt for AI Agents