kameecoding ,

But like, what kind of error are you gonna handle that's coming from the DB, if it's something like a connection error because the DB is down, then you are shit out of luck you can't handle that anyway, and you probably shouldn't, not from the layer you are calling your DB from, that's a higher level logic, so bubbling Errors there make sense.

and if it's an "error" like findById doesn't always return something, that's what the Optional pattern is for.

what you have described to me seems like a worse version of the checked/unchecked exception system.

  • All
  • Subscribed
  • Moderated
  • Favorites
  • random
  • fediverse@lemmy.world
  • test
  • worldmews
  • mews
  • All magazines