Hacker News new | ask | show | jobs
by valcron1000 226 days ago

    } catch (exception: Exception) {
      // log exception
      throw exception
    }
Probably the most harmful snippet ever written. Every blog post about errors has something similar written, regardless of the programming language. Please, don't write, suggest or even pretend that this should exist.
1 comments

Whats the problem ? Is throwing directly better here ? Given the annotations I presume this is spring so it will probably be logged anyway. So maybe its unnecessary here.