110
frugant
6y

At customer site with my boss.

Boss: let's check this code which is not working

Me: ok (starting the debugging session)

I found this code, which was failing during the writing on disk for some reasons.

try
{
....
writer.writeline(some data);
....
}
catch(Exception ex)
{
....
}

Boss: ok it fails to write data but we need to, let's manage it like this:

try
{
....
writer.writeline(some data);
....
}
catch(Exception ex)
{
writer.writeline(some data);
....
}

Comments
  • 33
    chmod 777 *
  • 27
    And?! Did it work?!! The tension is killing me..
  • 31
    Tell your boss to put the try-catch statements in a while(1){} loop to force the data out.
  • 6
    @Big-R it worked only in their mind.
  • 10
    Doesn't your boss know he should put it in a finally{}? 😂
  • 1
    Does it even catch an exception, so you actually know what's wrong?
  • 0
    What was the result of "ex"?
  • 6
    @xewl @-ANGRY-CLIENT it was an IOException (I don't remember why) but he had the bad convintion that by retrying in the catch block the code can't throw anymore the same exception :/
  • 6
    You need to fire your boss. Also, welcome to devRant :)
  • 1
  • 5
    If you fail try until you succeed!
    do {
    Exception ex = null;
    try {
    //Write code
    } catch(Exception e) {
    ex = e;
    }
    } while (ex != null);

    (P.S.- Don't code like this!)
  • 1
    @hexc thank you lol😂😂😂😂
Add Comment