❔ Catching Exceptions with generic parameters?
When adding an entity to the database, i first check if it already exists and if it does I throw an error. Now since I have alot of entities I was thinking of make an exception class that takes in a generic (the class type).
Unfortunately this doesn't work because I won't be able to catch it in my controller since I don't specify the generic.
4 Replies
I guess i could do this, but it feels weird doing reflection for the arguments from wherever the exception gets thrown
Thanks!
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.
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.