I do error handling on the back end which will log any error that happens into the DB, but I can't do this if the request never reaches the back-end once the front-end sends it. This very rarely happens and it's usually in requests with a problematic file (be it for high size, corrupt file, etc.)
I'm using VueJS alongside .NET 6.0. Something I thought of is sending a new request just to log the exception in the DB if the front-end finds the request didn't reach the back-end correctly, but maybe there's a better practice.
I do error handling on the back end which will log any error that happens into the DB, but I can't do this if the request never reaches the back-end once the front-end sends it. This very rarely happens and it's usually in requests with a problematic file (be it for high size, corrupt file, etc.)
I'm using VueJS alongside .NET 6.0. Something I thought of is sending a new request just to log the exception in the DB if the front-end finds the request didn't reach the back-end correctly, but maybe there's a better practice.
Share Improve this question edited Feb 7 at 7:44 VLAZ 29k9 gold badges62 silver badges83 bronze badges asked Feb 6 at 15:56 Luis Angel Urena LopezLuis Angel Urena Lopez 3891 gold badge6 silver badges21 bronze badges1 Answer
Reset to default 0Without knowing more about your architecture, this would come down to whether or not you want to expose logging database to your frontend. Your options are:
- As you said, make a subsequent request to the server, which may or may not succeed, but probably has a higher likelihood of succeeding. I would chose this if I didn't want to expose my log storage to the frontend
- Setup a clientside log storage. AWS Rum is what I've used in the past. In fact, I'm using AWS Rum with a Vue application for a client right now
By using Rum, you can choose to store only Frontend errors in the frontend log storage, and reserve the backend log storage for server side issues.