Giter Club home page Giter Club logo

Comments (4)

mwinkel-dev avatar mwinkel-dev commented on June 16, 2024

If the goal of SsINTERNAL is to alert the user to an extremely abnormal condition that should never arise during normal operation of MDSplus, then another approach is to throw an exception immediately. Instead of functions using return SsINTERNAL, replace those lines with a macro that displays an error message and then terminates the program.

The issue with the current code is that it masks errors by treating SsINTERNAL as a flavor of success. The current code "swallows" the SsINTERNAL and hides it from the user. The user is thus unaware that an abnormal condition occurred.

from mdsplus.

zack-vii avatar zack-vii commented on June 16, 2024

SsInternal is used to flag a situation that requires internal handling. i think it is used in remoteacces of treeshr to indicate a remote operation failed because of x is not supported so the code will try method y... something like that.

from mdsplus.

zack-vii avatar zack-vii commented on June 16, 2024

that said i agree the ok, error, true, and false should bbe consolidated tto follow one schema. but earlier attempts failed is it was either unclear if the methods are used by users (so we cannot chamge behaviour) and it was not always clear if 0 means success or false. we ended up replacing 0, 1 and -1 with the names you listed in order to help with that. however, noone dared to switch true/false to success/error or vice versa because we were afrait we would break code. today we have a better separation of public and private headers. so its worth checking if former concerns still hold

from mdsplus.

mwinkel-dev avatar mwinkel-dev commented on June 16, 2024

Hi @zack-vii -- Thanks for the history.

If you would prefer to discuss this via a Zoom meeting, let me know and I'll arrange to be available at whatever time is convenient for you. (There are times when a complex topic is easier to handle with a discussion than with the written word.)

Reverting to the written word, I will try again to communicate the issue.

In my opinion, there is a difference between what we expect SsINTERNAL to do and what the code actually does.

There are three separate issues here.

  • I concur that there are risks in consolidating the error schemas. And I am hesitant to recommend such consolidation, given the potential impact on the customers, plus the current level of regression testing.
  • Please review all of the links to the lines of code given in the bug report. Which portions of that code do you recommend be changed? In this example, the lowest-level routine can generate SsINTERNAL and none of the routines in the entire call stack check or handle the SsINTERNAL. (More accurately stated, they do check the status but ignore the SsINTERNAL because they view it as "success".) Shouldn't that instead be considered an error?
  • Throughout the MDSplus source code, there are other instances similar to the above example. What is the "best practice" for fixing those code sections?

from mdsplus.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.