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

Yaml export errors now don't show stack trace #1449

Merged
merged 4 commits into from May 7, 2022

Conversation

apainintheneck
Copy link
Contributor

@apainintheneck apainintheneck commented Apr 20, 2022

Checklist

  • I have read the contributing doc.
  • I have included a link to the relevant issue number.
  • I have checked to ensure there aren't other open pull requests
    for the same issue.
  • I have written new tests for these changes, as needed.

This is a fix for the bug mentioned in #1227 related to failed YAML exports showing the stack trace along with an error message. Now it just shows the error message.

Instead of printing an error message and returning none, I changed it to throw a RuntimeError. The advantage of this is that the calling function doesn't throw a TypeError when it gets back a none value instead of a string. It also gives us the opportunity to clean up the file that was open.

Closes #1227.

jrnl/plugins/text_exporter.py Outdated Show resolved Hide resolved
Copy link
Member

@micahellison micahellison left a comment

Choose a reason for hiding this comment

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

Looks great! Thanks for your contributions.

@micahellison micahellison added the bug Something isn't working label May 7, 2022
@micahellison micahellison merged commit 74200f8 into jrnl-org:develop May 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Directory YAML export shows stack trace when it doesn't need to
3 participants