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

Catch UncaughtException when serving in non-Markbind directories #2592

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

AgentHagu
Copy link

@AgentHagu AgentHagu commented Feb 3, 2025

What is the purpose of this pull request?

  • Documentation update
  • Bug fix
  • Feature addition or enhancement
  • Code maintenance
  • DevOps
  • Improve developer experience
  • Others, please explain:

Overview of changes:
Fixes #2570

Currently, there is an issue when using the markbind serve command in non-Markbind directories, leading to an UncaughtException that is displayed to the user.

The problem seems to be due to be a missing process.exit() after catching the error. This leads to the code continuing on despite the rootFolder still being undefined.

Anything you'd like to highlight/discuss:
This PR only fixes the UncaughtException issue, not the underlying issue mentioned in #1825.

Testing instructions:
Try using the markbind serve command in a non-Markbind directory. The UncaughtException should not show. For example:
image

Proposed commit message: (wrap lines at 72 characters)
Catch UncaughtException when serving in non-Markbind directories


Checklist: ☑️

  • Updated the documentation for feature additions and enhancements
  • Added tests for bug fixes or features
  • Linked all related issues
  • No unrelated changes

Reviewer checklist:

Indicate the SEMVER impact of the PR:

  • Major (when you make incompatible API changes)
  • Minor (when you add functionality in a backward compatible manner)
  • Patch (when you make backward compatible bug fixes)

At the end of the review, please label the PR with the appropriate label: r.Major, r.Minor, r.Patch.

Breaking change release note preparation (if applicable):

  • To be included in the release note for any feature that is made obsolete/breaking

Give a brief explanation note about:

  • what was the old feature that was made obsolete
  • any replacement feature (if any), and
  • how the author should modify his website to migrate from the old feature to the replacement feature (if possible).

Copy link
Contributor

@Tim-Siu Tim-Siu left a comment

Choose a reason for hiding this comment

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

Thanks for the good catch! The process is indeed supposed to exit after catching the error.

Copy link
Contributor

@gerteck gerteck left a comment

Choose a reason for hiding this comment

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

Copy link
Contributor

@gerteck gerteck left a comment

Choose a reason for hiding this comment

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

LGTM! Nice catch! Love the simple fix 👍

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.

UncaughtException when running Markbind Serve in non-Markbind directories.
3 participants