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 parsing markdown error #68

Merged
merged 1 commit into from
Sep 17, 2019
Merged

Catch parsing markdown error #68

merged 1 commit into from
Sep 17, 2019

Conversation

dawranliou
Copy link
Collaborator

Problem: issue #48

Solution:

  • Rename clojurians-log.message-parser/parse2 to parse2-inner.
  • Add a parse2 function that wraps parse2-inner with try/catch. When
    error is caught, log the error and return the unparsed message.

@dawranliou dawranliou changed the title Catch parsing markdown error [WIP] Catch parsing markdown error Sep 16, 2019
Rename `clojurians-log.message-parser/parse2` to `parse2-inner`.
Add a `parse2` function that wraps `parse2-inner` with try/catch. When
error is caught, log the error and return the unparsed message.
@dawranliou
Copy link
Collaborator Author

Here's a snapshot if I catch any exception at the level of clojurians-log.message-parser/parse2. Note that any url, code block, and user-id are undecorated now. I'm facing a decision whether to catch the error at a lower level so we can preserve the url and user-id style. @plexus would you give me your input on this?

image

@plexus
Copy link
Member

plexus commented Sep 17, 2019

Yep, this is fine. We'll get to fixing the parser next, so this is just an extra resilience layer, better show the raw message then fail on the whole page.

@plexus plexus merged commit 5bb5831 into clojureverse:master Sep 17, 2019
@dawranliou dawranliou changed the title [WIP] Catch parsing markdown error Catch parsing markdown error Sep 17, 2019
@dawranliou
Copy link
Collaborator Author

Great! Thanks for merging. :)

@dawranliou dawranliou deleted the catch-parse-error branch September 17, 2019 13:45
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.

2 participants