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

[core][commands][quality] Ensure error reporting does not throw error #7716

Closed
kittaakos opened this issue May 1, 2020 · 1 comment
Closed
Labels
commands issues related to application commands core issues related to the core of the application quality issues related to code and application quality

Comments

@kittaakos
Copy link
Contributor

kittaakos commented May 1, 2020

Bug Description:

This is a cosmetic issue. If I commit a programmer error, and I mess up something with my commands and their handlers, I want to see a clear error about the problem, this happens usually, but not always. I can hit an Uncaught (in promise) TypeError: Converting circular structure to JSON error.

command.ts:298 Uncaught (in promise) TypeError: Converting circular structure to JSON
    --> starting at object with constructor 'TheiaDockPanel'
    |     property '_layout' -> object with constructor 'DockLayout'
    --- property '_parent' closes the circle
    at JSON.stringify (<anonymous>)
    at CommandRegistry.<anonymous> (command.ts:298)
    at step (command.ts:15)
    at Object.next (command.ts:15)
    at command.ts:15
    at new Promise (<anonymous>)
    at ../../packages/core/lib/common/command.js.__awaiter (command.ts:15)
    at CommandRegistry.../../packages/core/lib/common/command.js.CommandRegistry.executeCommand (command.ts:290)
    at TabBarToolbar._this.executeCommand (tab-bar-toolbar.tsx:184)
    at HTMLUnknownElement.callCallback (react-dom.development.js:336)

Related code:

const argsMessage = args && args.length > 0 ? ` (args: ${JSON.stringify(args)})` : '';

Steps to Reproduce:

  1. I do not know exactly. Try to execute a command without a handler and pass in a class instance. I am not sure though.

Help wanted: Maybe one can rebind the default JSON.stringify with a lib that handles it gracefully; for instance json-stringify-safe or a better one.

Additional Information

  • Operating System:
  • Theia Version:
@vince-fugnitto vince-fugnitto added commands issues related to application commands core issues related to the core of the application quality issues related to code and application quality labels May 1, 2020
@colin-grant-work
Copy link
Contributor

Closed via #8978

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
commands issues related to application commands core issues related to the core of the application quality issues related to code and application quality
Projects
None yet
Development

No branches or pull requests

3 participants