Catch UncaughtException when serving in non-Markbind directories #2592
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What is the purpose of this pull request?
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 beingundefined
.Anything you'd like to highlight/discuss:
This PR only fixes the UncaughtException issue, not the underlying issue mentioned in #1825.
Testing instructions:
![image](https://private-user-images.githubusercontent.com/50906253/408960634-6123293a-aafd-4437-b88f-f2a0fac21335.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkwOTcyODYsIm5iZiI6MTczOTA5Njk4NiwicGF0aCI6Ii81MDkwNjI1My80MDg5NjA2MzQtNjEyMzI5M2EtYWFmZC00NDM3LWI4OGYtZjJhMGZhYzIxMzM1LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMDklMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjA5VDEwMjk0NlomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTY5OWUwZDdhMmVkNmQ2ODI5NTM1MTE5MDRmMDEyNjA0MjEyYzgzYTQ1OWZlNTQ2OTAxYWNjZGIzOTk0ZDU5NWEmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.psw7oyVBK-QzON_Bz_91jtjqsEn2O-soVKjL8mkyKHI)
Try using the
markbind serve
command in a non-Markbind directory. The UncaughtException should not show. For example:Proposed commit message: (wrap lines at 72 characters)
Catch UncaughtException when serving in non-Markbind directories
Checklist: ☑️
Reviewer checklist:
Indicate the SEMVER impact of the PR:
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):