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

Exceptions are swallowed, and there is no way to see the line number where they are thrown. #79

Closed
geon opened this issue Jul 11, 2021 · 6 comments · Fixed by #81
Closed
Labels
enhancement New feature or request

Comments

@geon
Copy link
Contributor

geon commented Jul 11, 2021

It would be nice to know where the errors comes from. Print at least the line number. Possibly the entire stack trace.

@Aboisier Aboisier added the enhancement New feature or request label Jul 17, 2021
@Aboisier
Copy link
Collaborator

Thanks for filing this issue!

The logging definitely needs some improvements. I'll try and work on that this week. Any suggestions as to what the output could look like are welcome.

@geon
Copy link
Contributor Author

geon commented Jul 17, 2021

Current:

Root
  MeshTestSuite
    √ makeEmptyMesh
    √ addEdge
    √ makeLongEdgeMesh
    x extrudeCornerOnEdge - Bad id: -1
    √ meshGraphIsValid

Better:

Root
  MeshTestSuite
    √ makeEmptyMesh
    √ addEdge
    √ makeLongEdgeMesh
    x extrudeCornerOnEdge - Uncaught Error: Bad id: -1
        at Object.makeTestMesh (Mesh.ts?763c:198)
        at eval (main.ts?34d3:6)
        at Object../src/main.ts (bundle.js:248)
        at __webpack_require__ (bundle.js:488)
        at bundle.js:552
        at bundle.js:555      
    √ meshGraphIsValid

I basically just copied how Chrome prints thrown errors.

@geon
Copy link
Contributor Author

geon commented Jul 18, 2021

This also goes for expect.not.toThrow. If it is not expected to throw, the thrown error should probably be shown.

@Aboisier
Copy link
Collaborator

That's pretty clean! The stack was making the log a bit crowded, so I made the test suites bold to facilitate scanning.

stack-demo

@Aboisier
Copy link
Collaborator

Aboisier commented Jul 18, 2021

This will be deployed in version 2.0.0-beta.1 in a few minutes. Let me know if you get the change to test it!

Edit:
Actually, it was deployed in version 2.0.0-beta.2. 2.0.0-beta.1 was deployed by error a while ago apparently. 🤷‍♂️

@geon
Copy link
Contributor Author

geon commented Aug 1, 2021

That looks perfect.

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

Successfully merging a pull request may close this issue.

2 participants