From Discord: Handling Errors in Layer Instantiation and Bootstrapping in Complex Apps
Summary
Summary
User "wagmilson" is experiencing an issue with error handling in layer instantiation while building an application using the Effect-TS library. The problem is that errors inside the effect are not logged, and the application does not exit with an error. The user suspects that exporting the effect instead of the constructed layer might be a solution.
User "michaelarnaldi" suggests creating a minimal reproducible example (repro) to diagnose the issue. After some back and forth, "wagmilson" identifies that the problem might be related to the use of devtools. A minimal repro is finally shared, which demonstrates that the issue might be with the devtools affecting error propagation.
Key Takeaways
- Minimal Repro: Creating a minimal reproducible example is crucial for diagnosing issues effectively.
- Error Handling: Proper placement of error handling and logging is essential. It should be outside the program to catch all errors.
- DevTools Impact: Development tools can sometimes interfere with error logging and propagation, leading to silent failures.
- Effect-TS Playground: The Effect-TS playground is a useful tool for testing and sharing minimal examples, although it may have its own limitations and issues.
- Community Support: Engaging with the community and experts can help in diagnosing and resolving complex issues.
Next Steps
- Investigate DevTools: Further investigation into how devtools might be affecting error propagation.
- Use Playground: Utilize the Effect-TS playground for minimal examples to isolate and debug issues.
- Error Handling Best Practices: Ensure error handling is implemented correctly, outside the main program logic, to catch all potential errors.
Discord thread
https://discord.com/channels/795981131316985866/1265918006412968050