Paqmind / react-ultimate

React Ultimate Example
MIT License
303 stars 64 forks source link

Update actions calling #95

Closed scabbiaza closed 8 years ago

scabbiaza commented 8 years ago

All actions should return promise All actions have catch In all catches error will be printed in console For all errors user will see alert

scabbiaza commented 8 years ago

Could you pls write if i did it correct? After your feedback i will retest application and merge this branch

ivan-kleshnin commented 8 years ago

All actions should return promise

Agreed. Otherwise they are not composable.

All actions have catch In all catches error will be printed in console For all errors user will see alert

Disagreed.

If we add catch and console.log every error we basically disable debugging facility for ourselves. This is like debugging with alerts back to 90-x with random messages instead of stack traces. No way.

My original idea was that errors caused by backend should be notified by alerts. Frontend errors should not exist (they are bugs).

So some errors (like form errors) can be safely suppressed. While others should result in uncaughtException or whatever to be seen by functional tests and treated like common bugs.

To reitarete: actions which request remote APIs can raise alerts. Other actions – can not. Catch presense is derived from this reasoning.