• Brian Boorman (google)
    catch // completely useless, but comment anyway
    {
        echo "frist";
    }
    

    Addendum 2022-03-31 07:03: You know what else is Fubar? This comment system that strips out CRLF of posts.

  • MaxiTB (unregistered)

    It's the "no visible error allowed" doctrine, also called the "put the garbage into drawers instead of spreading it on the bed for everyone to see" pattern.

  • Hanzito (unregistered)

    I'm not fond of logging every bleeding little detail (open a linux syslog or macos console to see how crap much you can log) because it makes logging useless, but not even logging in the case of a serious error, that's a new low.

  • (nodebb)

    This approach seems to be getting more and more traction instead of being beaten with a stick. The idea that any error is bad so just act like you don't have any.. ugh.

  • I dunno LOL ¯\(°_o)/¯ (unregistered) in reply to Brian Boorman

    It's called "Markdown", and it's a whole WTF category unto itself.

  • Anon E. Mouse (unregistered) in reply to Hanzito

    But how do you know the REASON it's munged isn't the logging is broken so you CAN'T log. Oh, I guess, if you were a professional developer who knew WTF they were doing, you might catch THAT issue and handle it, then knowing logging isn't broken, log that it's FUBAR.

    But that's not the way we roll. Bleep it. Ship it.

  • (author) in reply to I dunno LOL ¯\(°_o)/¯

    Markdown is what happens when, instead of a specification, you have a reference implementation.

  • (nodebb) in reply to Remy Porter

    Oooooohhhhh is that why everyone re-implements their own flavor?

  • MaxiTB (unregistered) in reply to Hanzito

    You should at least log an error in such an case, because there could be other unexpected issues happening like an DB Connection timeout, a race condition, a dead lock scenario, an network connection time, a division by zero, etc.

    Logging never hurts, if you use a proper framework the impact in such cases is not even worth mentioning but the value for potential bug tracking can be worth more than months of development hours.

  • (nodebb)

    I dunno..... Everybody here knows "Error Checking" is when the application verifies a distribution account that the user may have mistyped and "Exception" happens because of a bad array index, duplicate primary key, nonexistent object, invalid data type, or division by zero. While I agree that an empty catch is a WTF (especially when it is intentionally crafted to bypass a fubar), TRWTF here is that the program is known to throw exceptions and nothing was done to recover from it.

    "Sorry, I can't divide the balance by zero monthly payments."

    "Oh, that's OK - you just go right ahead and cut a check for $NaN"

    Addendum 2022-03-31 10:20: EDIT: Yes, I know I described Data Validation, but my use of it here is because, if you typed a bad account, it will cause an error.

  • (nodebb)

    Perhaps the comment should have read

    catch (Exception ex) {
       LogManager.getLogger().log.error("Payment Processing FUBAR", ex);
       //Don't risk logging critical financial information due to potential vulnerabilities in the underlying logging framework #log4shell. 
    }
    

    Addendum 2022-03-31 10:31: Damnit, there was a bug in my comment. should have read.

    catch (Exception ex) {
       //LogManager.getLogger().log.error("Payment Processing FUBAR", ex);
       //Don't risk logging critical financial information due to potential vulnerabilities in the underlying logging framework #log4shell. 
    }
    
  • Hasseman (unregistered)

    Is this what caused the British Post Office Scandal?

    https://en.wikipedia.org/wiki/British_Post_Office_scandal

  • Scott (unregistered)

    Having to work with the willfully ignorant and lazy is what drove me into retirement.

  • Barf4Eva (unregistered)

    catch // Cthulhu here { }

  • Pecked Hen (unregistered)

    catch { // me if you can }

  • Behodar (unregistered) in reply to MaxiTB

    Closely related to apps/websites that say nothing more than "something went wrong" on any failure, giving you (the end user) no chance of actually finding/fixing the problem.

  • Loren Pechtel (unregistered)

    I didn't mind the previous empty catch block in the logging routine but this is insane. The only acceptable reason for something like this is when it's a do-or-die type situation. You lit the rocket, it's orbit or bust. An empty catch block would have saved the first Ariane V launch--the fubared data was actually completely moot at that point. (The program was meant for use on the pad, not in flight.)

  • Barf4Eva (unregistered) in reply to Loren Pechtel

    This makes sense to me, basically a top-level try-catch-do-nothing. Obviously it gets more in-depth that that with logging, logger failed so backup logger, that failed so retry pattern, that failed so events viewer, etcetcetc, that failed so do-nothing catch block. :)

  • Nick (unregistered) in reply to Behodar

    Ensuring the output to the end-user is minimal and meaningless is a security thing.

    Some (most?) of the time, an error on a website is something the end-user can do nothing about. The database being offline, or something missing is not something you can fix unless you are the admin or maintainer of the site - and those individuals hopefully have access to detailed logs that do say something more than “Something went wrong”.

    When it’s a user-fixable error though, that’s when it’s scary. That would mean your input data can cause unexpected behaviour in the system… so it’s really important that the end-user doesn’t find out too much about what caused the problem, because that’s exactly the kind of information that can be used to find serious security vulnerabilities.

    Unfortunately, that means it’s not even safe to hint to the user that this might or might not be something they can fix - because even knowing the issue might be fixable is enough for a criminal hacker to use to figure out if they’re on the right track for breaking into a system.

    Once again, the criminal behaviour of a small subset of the population is responsible for the suffering the rest of us endure… this is why we can’t have nice things!

  • Daniel (unregistered) in reply to Loren Pechtel

    While it's correct that an "empty" catch block would have saved the launch in that case it's equally possible that an empty catch could lead to serious safety issues due to continued process after a critical error. So just because it would have helped in one case doesn't make this less a WTF.

  • Officer Johnny Holzkopf (unregistered) in reply to Behodar

    You don't need the web or an app for that. Your ordinary home or office PC can already do it just fine: "Something happened. :( Your PC ran into a problem that it couldn't handle, and now it needs to restart."

  • Joy (unregistered)
    Comment held for moderation.
  • Joy (unregistered)
    Comment held for moderation.
  • Joy (unregistered)
    Comment held for moderation.
  • nunya business (unregistered)
    Comment held for moderation.
  • Taylor Son (unregistered)
    Comment held for moderation.
  • Taylor Son (unregistered)
    Comment held for moderation.
  • Taylor Son (unregistered)
    Comment held for moderation.
  • crackmyapp (unregistered)
    Comment held for moderation.
  • Haru Den (unregistered)
    Comment held for moderation.
  • Taylor Son (unregistered)
    Comment held for moderation.

Leave a comment on “Caught Something”

Log In or post as a guest

Replying to comment #:

« Return to Article