-
Notifications
You must be signed in to change notification settings - Fork 1
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
Make server not crash when there's a syntax error in server.js #44
Comments
@michael, did you mean syntax error inside browserify bundle? |
Exactly. Server crashes then. |
OK, but how do you then know that it fails? Via terminal message? On Sun, Jun 21, 2015, 15:52 Michael Aufreiter notifications@github.com
|
Ideally it outputs the error on the screen too, not only console. |
@michael, why did you drop out browserify middleware? It is not crushes the server and you can use it like this: |
We wanted less overhead, because we don't use any smart caching and fole watching, that browserify-middleware implements. Oliver just made the change. It's not so tragic when the server crashes for now, but if you have an idea how to fix it, please try and push it if its working. |
ok, you can do it like this https://github.com/substance/tahi-journal/commit/ce3da633127ceaa8cbf6e4ddc008dfc16cfa1de5 |
and of course it will not crash your server ;) |
bravo daniel! :) seems that order of the handler did matter. Do we really need the try catch block inside the error handler? |
yes, it did! because you need to attach error listner to bundle function ;) |
I did this now. So it prints the error in the console in the browser also. |
and now try http://localhost:5000/1 |
See tahi-journal.
Seems this is not enough error handling:
I tried adding a try-catch but still i get:
The text was updated successfully, but these errors were encountered: