Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Add NO_THROW setting to dismiss throwing exceptions#90

Closed
kjkta wants to merge 2 commits into
markfinger:mastermarkfinger/python-react:masterfrom
kjkta:masterkjkta/python-react:masterCopy head branch name to clipboard
Closed

Add NO_THROW setting to dismiss throwing exceptions#90
kjkta wants to merge 2 commits into
markfinger:mastermarkfinger/python-react:masterfrom
kjkta:masterkjkta/python-react:masterCopy head branch name to clipboard

Conversation

@kjkta

@kjkta kjkta commented Apr 7, 2019

Copy link
Copy Markdown

In production it's not ideal to rely on the render_server being alive to serve a request. In an exception case the application will throw without giving the chance to "give up" on SSR and load the JS on the client.

@markfinger

Copy link
Copy Markdown
Owner

Thanks for the PR.

I agree that silent failure's probably a safe default in a lot of cases, but it also has the likelihood of burying errors and making it more difficult to detect failures.

Any project without process monitoring will be reliant on manual testing of functionality, which will be much more difficult with silent SSR failures. For example, if the browser's cached assets, the time before the client-side code mounting may be imperceptible, even for someone looking for failure.


Can you change the default value of the setting from not Debug to False?

Also, do you mind expanding on the setting in the README? Something like

In some production scenarios it's not ideal to rely on the render server ability to serve a request. If this setting is set to True, the library will silently ignore render server errors and return empty strings as the markup.

@mic159

mic159 commented Apr 7, 2019

Copy link
Copy Markdown
Contributor

I would suggest still throwing the exception, but catching it when the setting is on and logging it. Like what I did with FAIL_SAFE setting on react-render.

That way you still get an error in your logs, and you can still inspect the stack trace in something like sentry.

@kjkta

kjkta commented Apr 8, 2019

Copy link
Copy Markdown
Author

Thanks for the reply guys!

And both of you are totally right... this was my quick fire response to handling some time out issues (which I should find the source of).

But I'm happy it brought up the discussion. I think the outcome would be adding an example to the README demonstrating how you could avoid hard fails in production. When I put together a solution I will share.

@kjkta kjkta closed this Apr 8, 2019
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.

3 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.