DO NOT REMOVE!!eleven


  • BINNED

    catch (Ex90013Exception ex)
    {
    /*
    standard logging, as in the rest of the app
    */

        // DO NOT REMOVE THE FOLLOWING SECTION!!
        // This will form the basis of associating components
        if (forceFullTraceValidation)
        {
        //    decimal Qty = foo.Quantity;
        //    foreach (TreeViewItem assembly in bar.TreeViewItems)
        //    {
        //        //AssociationAdjustment assAdj = assembly.associationAdjustment;
        //        //assAdj.Populate( Coordinator.BuildComponents[ 0 ] );
    
        //        TreeViewItem comps = assembly.ComponentItems;
    
        //        foreach (TreeViewItem comp in comps)
        //        {
        //            AssociationAdjustment compAdj = comp.associationAdjustment;
    
        //            foreach (AssociationItem traceAdj in compAdj.AssociationItems)
        //            {
        //                if (traceAdj.AvailableQuantity > 0 && traceAdj.Quantity == 0)
        //                {
        //                    traceAdj.Quantity = 1;
        //                    break;
        //                }
        //            }
        //        }
        //    }
    
            //if some kind of error then we give up!
        //        throw ex;
        }
    }
    

    A bit of logging that's pretty standard for catch blocks in this part of the code. Then the WTF starts:

    • A scary sounding warning comment
    • followed by a commented out load of code (revision history? No, lets keep it all in the code)
    • not all commented, the if block is still there, checking a boolean for no good reason
    • throw ex - because who needs the original stack trace?
    • the original code had three nested foreach loops in the catch. It obviously wasn't a particularly necessary cleanup or it would still be there rather than being commented

    Oh,and that Exception type isn't anonymised - that's the actual type (that one is a Sage WTF)


  • Winner of the 2016 Presidential Election

    @Jaloopa said:

    Oh,and that Exception type isn't anonymised - that's the actual type (that one is a Sage WTF)

    Do you guys have 90k Exceptions or is there some kind of pattern that makes at least the number make sense? (some ISO maybe?)

    Filed Under: Make an Exception for every bug in Discourse



  • I would also add as a WTF all that code in an error handling block.

    catch (Ex90013Exception ex) {
        handleEx90013Exception(ex);
    }
    

    @Jaloopa said:

    Oh,and that Exception type isn't anonymised - that's the actual type (that one is a Sage WTF)

    No results found for Ex90013Exception


  • sockdevs

    @Jaloopa said:

    throw ex - because who needs the original stack trace?

    Not that it matters; it's commented out! :laughing:
    @Jaloopa said:
    that one is a Sage WTF

    I work with a number of ex-Sage guys...


  • BINNED

    @Kuro said:

    Do you guys have 90k Exceptions

    The exceptions are part of the Sage API. I have no idea what the rationale behind the naming convention is, and I'm not sure I want to


  • Discourse touched me in a no-no place

    @Jaloopa said:

    throw ex - because who needs the original stack trace?

    This is C#? That would be cromulent in Java (because of the different way it handles exceptions).



  • Probably. In C#, if you want the stack trace, you just throw;; throw ex; resets the stack trace.

    SEMICOLONS!


  • BINNED

    Correct. This is C#



  • Uggh, my company uses a heavily-customized Sage CRM product, and there are so many WTFs in there that I wouldn't even know where to start describing them. This doesn't surprise me at all.



  • @chubertdev said:

    CRM... ...WTFs

    Yes.



  • @Eldelshell said:

    No results found for Ex90013Exception



  • @Jaloopa said:

    Oh,and that Exception type isn't anonymised

    Seems like someone's been looking up to Oracle. When was it that we stopped needing error numbers, early 2000s?



  • Still better than Sage Timberline - that's a stinking pile of crap if there ever was one. Most of the time it's installed on a terminal server, since any kind of a bad connection can cause the DB to get corrupted (e.g. Jim 3 desks over sneezed, restore from backup).

    Oh, and did I mention that it's for construction accounting - probably the worst network connections imaginable (oops, the backhoe cut the line again). So bad connections are the norm.



  • So it's literally just this:

    catch (Ex90013Exception ex)
    {
        if (forceFullTraceValidation)
        {
        }
    }
    

    Seems useful


Log in to reply
 

Looks like your connection to What the Daily WTF? was lost, please wait while we try to reconnect.