C
C#12mo ago
shuu

❔ Is Storing Predefined Error in Database a good approach

Hey guys, if it were you, would you rather store predefined errors in database, if error happen during query process then just throw it from procedure, and inside ASP.NET Core error handling middleware, just put the message and status code that sent back from database into the response body? I'm new to this so can you guys give me some thought about this and some better alternative approaches
4 Replies
ffmpeg -i me -f null -
i'm not 100% following but i will say this: the reason you put stuff in database is because 1) it can be updated 2) it has relationships 3) it's shared between services if error messages are static, they are not editable templates or whatever (for example translations), perhaps i would not put them in a database
JakenVeina
JakenVeina12mo ago
the usual process for that kinda thing is to shove all your messages and other localization bits into a separate assembly they can still be swapped out, but it doesn't need to be quite so dynamic as a database
ffmpeg -i me -f null -
so you would have a key, or slug, for the string
Accord
Accord12mo ago
Was this issue resolved? If so, run /close - otherwise I will mark this as stale and this post will be archived until there is new activity.
Want results from more Discord servers?
Add your server
More Posts
duplicate outputs for usb inserted eventim trying to get a device ID so i can compare it to a list in a data base, how ever i seem to be get✅ AngelSix YouTube Series, cannot get position to work on popup -- Avalonia```cs using Avalonia; using Avalonia.Controls; using Avalonia.Media; using System; namespace Loudne❔ Programs Wont runWhenever I try and run my programs It makes me choose a debugger and doesnt run❔ Form.Control list all buttons but Form.Controls.OfType<Button> does notAny reason as to why this occurs ? Any weird bug on WinForms I should know about ?❔ Attributes for commands: implementing "feature search"Background: So I have worked on a simple text editor app and have a MainViewModel full of commands t❔ Program showing unwanted entries after multiple usesWhenever I run my method that returns all data entries from my database, it shows me extra entries a❔ App is sometimes slow after starting, but fast other times(This is a WPF app) I don't really know how else to describe it other than sometimes when I start th❔ getting all methods with an attribute in an optimized wayhey all, im trying to find a way to add all methods with an attribute to dictionary. i want to be ab❔ anyone interested in helping a starter?Im a starter looking to start learning c#. after spending days researching where to start im still k❔ How to mock HttpClient that is automatically applied in class without IHttpClientFactoryHello, I have a problem because I don't know how can I mock ``HttpClient`` in my tests for ``StripeC