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

Handle potential errors in footer parsing #836

Closed
jameshadfield opened this issue Dec 16, 2019 · 7 comments
Closed

Handle potential errors in footer parsing #836

jameshadfield opened this issue Dec 16, 2019 · 7 comments

Comments

@jameshadfield
Copy link
Member

I've implemented Error Boundaries in a few places, but not consistently and not that well. Since we do a lot of data processing on the client, we are prone to errors which may bring the app (client) down. One such place is in the parsing of footer markdown. The output of this should be wrapped in an Error Boundary (or a simple try/catch used as we parse the data.

@andressrudqvist
Copy link
Contributor

Hi James,

I would like to work on this issue. I think that something like this would do the job.

    let cleanDescription;
    try 
    {
      const rawDescription = marked(metadata.description);
      cleanDescription = sanitizer(rawDescription, sanitizerConfig);
    } catch (error) {
      console.error('Error parsing footer description'+error)      
      cleanDescription = (<h1>Something went wrong.</h1>);
    }

Regards,

Andres

@jameshadfield
Copy link
Member Author

Yes, I think this would be good 👍

Let's change <h1>Something went wrong</h1> to <p>There was an error parsing the footer description.</p> or similar.

@andressrudqvist
Copy link
Contributor

Hi James,

I modified the message. I made a branch and the modified code is.

@jameshadfield
Copy link
Member Author

Great! Can you make a PR into this repo so I can test & merge?

@andressrudqvist
Copy link
Contributor

Hi James, the PR is already merged. As part of this issue would you like me to implement Error Boundaries in other key components?

Andres

@andressrudqvist
Copy link
Contributor

For reference this is the PR URL:
#1058

@jameshadfield
Copy link
Member Author

Closed by #1058

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants