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

🚀 Feature: Better visualization of nested errors #736

Open
3 tasks done
JoshuaKGoldberg opened this issue Aug 31, 2023 · 1 comment
Open
3 tasks done

🚀 Feature: Better visualization of nested errors #736

JoshuaKGoldberg opened this issue Aug 31, 2023 · 1 comment
Assignees
Labels
status: needs investigation Further research required...? type: feature New enhancement or request

Comments

@JoshuaKGoldberg
Copy link
Owner

Bug Report Checklist

  • I have tried restarting my IDE and the issue persists.
  • I have pulled the latest main branch of the repository.
  • I have searched for related issues and found none that matched my issue.

Overview

Right now, if something throws an error, the whole error is logged - including nested call stacks. For example, in #735, what's logged is:

Error: Failed initializing GitHub repository
    at withSpinner (file:///Users/josh/.npm/_npx/4aa729db9999bfc4/node_modules/create-typescript-app/lib/shared/cli/spinners.js:16:11)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async migrateWithOptions (file:///Users/josh/.npm/_npx/4aa729db9999bfc4/node_modules/create-typescript-app/lib/migrate/migrateWithOptions.js:43:5)
    at async run (file:///Users/josh/.npm/_npx/4aa729db9999bfc4/node_modules/create-typescript-app/lib/migrate/index.js:11:7)
    at async runOrRestore (file:///Users/josh/.npm/_npx/4aa729db9999bfc4/node_modules/create-typescript-app/lib/shared/runOrRestore.js:7:5)
    at async Object.migrate (file:///Users/josh/.npm/_npx/4aa729db9999bfc4/node_modules/create-typescript-app/lib/migrate/index.js:9:10)
    at async bin (file:///Users/josh/.npm/_npx/4aa729db9999bfc4/node_modules/create-typescript-app/lib/bin/index.js:47:10)
    at async file:///Users/josh/.npm/_npx/4aa729db9999bfc4/node_modules/create-typescript-app/bin/index.js:4:20 {
  [cause]: Error: Command failed with exit code 1: gh label edit documentation --color 0075ca --description Improvements or additions to docs --name area: documentation
  label with name "area: documentation" already exists
      at makeError (file:///Users/josh/.npm/_npx/4aa729db9999bfc4/node_modules/execa/lib/error.js:60:11)
      at handlePromise (file:///Users/josh/.npm/_npx/4aa729db9999bfc4/node_modules/execa/index.js:124:26)
      at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
      at async initializeRepositoryLabels (file:///Users/josh/.npm/_npx/4aa729db9999bfc4/node_modules/create-typescript-app/lib/steps/initializeGitHubRepository/labels/initializeRepositoryLabels.js:17:7)
      at async initializeGitHubRepository (file:///Users/josh/.npm/_npx/4aa729db9999bfc4/node_modules/create-typescript-app/lib/steps/initializeGitHubRepository/index.js:9:3)
      at async file:///Users/josh/.npm/_npx/4aa729db9999bfc4/node_modules/create-typescript-app/lib/migrate/migrateWithOptions.js:44:7
      at async withSpinner (file:///Users/josh/.npm/_npx/4aa729db9999bfc4/node_modules/create-typescript-app/lib/shared/cli/spinners.js:11:20)
      at async migrateWithOptions (file:///Users/josh/.npm/_npx/4aa729db9999bfc4/node_modules/create-typescript-app/lib/migrate/migrateWithOptions.js:43:5)
      at async run (file:///Users/josh/.npm/_npx/4aa729db9999bfc4/node_modules/create-typescript-app/lib/migrate/index.js:11:7)
      at async runOrRestore (file:///Users/josh/.npm/_npx/4aa729db9999bfc4/node_modules/create-typescript-app/lib/shared/runOrRestore.js:7:5) {
    shortMessage: 'Command failed with exit code 1: gh label edit documentation --color 0075ca --description Improvements or additions to docs --name area: documentation',
    command: 'gh label edit documentation --color 0075ca --description Improvements or additions to docs --name area: documentation',
    escapedCommand: 'gh label edit documentation --color 0075ca --description "Improvements or additions to docs" --name "area: documentation"',
    exitCode: 1,
    signal: undefined,
    signalDescription: undefined,
    stdout: '',
    stderr: 'label with name "area: documentation" already exists',
    cwd: '/Users/josh/repos/all-contributors-auto-action',
    failed: true,
    timedOut: false,
    isCanceled: false,
    killed: false
  }
}

What an awfully verbose way to log things! Most of those lines are useless, such as the node_modules/ logs.

I want to:

  • See if someone's written a good error visualization package already
  • Write my own if not

Additional Info

No response

@JoshuaKGoldberg JoshuaKGoldberg added type: feature New enhancement or request status: needs investigation Further research required...? labels Aug 31, 2023
@JoshuaKGoldberg JoshuaKGoldberg self-assigned this Aug 31, 2023
@JoshuaKGoldberg
Copy link
Owner Author

Looking at existing packages in the wild:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: needs investigation Further research required...? type: feature New enhancement or request
Projects
None yet
Development

No branches or pull requests

1 participant