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

(KED-1516) Stop kedro-viz from swallowing stacktraces #142

Merged
merged 5 commits into from
Apr 14, 2020

Conversation

mzjp2
Copy link
Contributor

@mzjp2 mzjp2 commented Apr 3, 2020

Description

I'm a little uneasy about my approach here, so would welcome comments. Also, I guess this only prints stacktraces for generic exceptions and not for exceptions that are already KedroCLIError's (from _call_viz) -- should I do it there too?

When there's an underlying generic exception (e.g in your pipeline file, missing a comma or some syntax issue) kedro-viz silently prints something like Error: invalid syntax (pipeline.py, line 64) without the (sometimes helpful) stacktrace.

Development notes

Use traceback to print the stacktrace before continuing with the KedroCLIError. Sadly the usual raise a from b trick doesn't work here because of the way click handles exceptions (and our custom KedroCLIError inherits from click.Exception).

QA notes

Added a test that makes sure that the traceback is printed when _call_viz returns a ValueError.

Checklist

  • Read the contributing guidelines
  • Opened this PR as a 'Draft Pull Request' if it is work-in-progress
  • Updated the documentation to reflect the code changes
  • Added new entries to the RELEASE.md file
  • Added tests to cover my changes

Legal notice

  • I acknowledge and agree that, by checking this box and clicking "Submit Pull Request":

  • I submit this contribution under the Apache 2.0 license and represent that I am entitled to do so on behalf of myself, my employer, or relevant third parties, as applicable.

  • I certify that (a) this contribution is my original creation and / or (b) to the extent it is not my original creation, I am authorised to submit this contribution on behalf of the original creator(s) or their licensees.

  • I certify that the use of this contribution as authorised by the Apache 2.0 license does not violate the intellectual property rights of anyone else.

@mzjp2 mzjp2 changed the title Fix/swallow stacktrace (KED-1516) Stop kedro-viz from swallowing stacktraces Apr 3, 2020
Copy link
Contributor

@DmitriiDeriabinQB DmitriiDeriabinQB left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice 👍

package/tests/test_server.py Outdated Show resolved Hide resolved
Co-Authored-By: Dmitrii Deriabin <44967953+DmitriiDeriabinQB@users.noreply.github.com>
Copy link
Contributor

@richardwestenra richardwestenra left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🕵🔎 Yep, looks like Python to me
image

@mzjp2 mzjp2 merged commit a597c2e into develop Apr 14, 2020
@mzjp2 mzjp2 deleted the fix/swallow-stacktrace branch April 14, 2020 10:57
@richardwestenra richardwestenra mentioned this pull request May 26, 2020
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.

3 participants