Improve error reporting and logging
See original GitHub issueI had wrong imports of functions and wanted to use them in take(invalidMethod)
and all I got was a mysterious invalid type error in the console. I did not know which saga it originated from.
I understand that redux-saga cannot know where it comes from.
Therefore I am thinking maybe we can extend the saga steps with optional comments, that will help to improve error reporting.
yield log(take(WAIT_FOR_ACTION), "Waiting for action")
yield log(call(asyncFunc, withParams), "Calling async function")
yield log(put(SET_RESULT_ACTION), "Setting the result of the async call")
It would not break the existing API What you think?
Proposed implementation:
function *log(func, message) {
console.log(message)
yield func
}
Issue Analytics
- State:
- Created 8 years ago
- Reactions:1
- Comments:8 (7 by maintainers)
Top Results From Across the Web
Pump Up the Volume: Tips for Increasing Error Reporting and ...
Error -reporting systems continue to be an important tool for improving patient safety and often represent one of the primary means by which ......
Read more >6 Ways To Make Error Logs Your New Secret Weapon
1. Don't treat all errors the same · 2. Make sure each error log provides context · 3. Monitor frequency next to the...
Read more >Error Reporting documentation | Google Cloud
You can report errors from your application by sending them directly to Cloud Logging with proper formatting or by calling an Error Reporting...
Read more >Error Reporting and error logging - YouTube
In this episode of Stack Doctor, Yuri Grinshteyn speaks to the multiple ways that you can log errors in Stackdriver.
Read more >10 Ways to Take Your Error Logs Up a Level - Coralogix
7. Refine your error logs and error handling together · Are there any error or exception code statements missing associated log statements? ·...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I’m not sure if this is related to this issue but I’ve just started to work with sagas and I find almost impossible to debug saga code. The main issues I have are:
call
inside a saga) nor the stack trace or the error message is meaningfulI’m using the latest version of Chrome but I’ve also tried Safari and Chrome. Most likely these issues are not directly related to redux-saga but I wonder if there is a way to support developers in the debugging process because right now I think it is really really hard
@pke I think you can implement the
log
utility without involving the core.put
,take
, … are simple pure functions which return plain objects so you can just wrap them in whatever you want