Comments (4)
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.
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.
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.
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 theSsINTERNAL
. (More accurately stated, they do check the status but ignore theSsINTERNAL
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)
- Activating the `MDSDBG()` debug statements generates compiler errors
- Building on conda forge OSX fails HOT 12
- Mdstcl's "dispatch" feature can trigger segfaults and other errors if flood the "action server" with hundreds of actions HOT 6
- Missing "mdsobjectscppshr-vs.lib" in vs devtools lib32 folder HOT 6
- alpha versions fail to raise MDSconnection issue HOT 8
- Mdstcl segfaults for a tree that doesn't carry a shot number HOT 2
- The information and links in `mdstcl show version` are out of date
- RW on mds+ shotfiles for "group" in linux HOT 4
- NFSLOCKING problem - non reproducible HOT 11
- Is it possible to limit the amount of concurrent connections of a specific user HOT 2
- Have TCL's `show version` command also display the build date HOT 1
- In `tdi/RfxDevices/DIO2` initialization, remove the flag that triggers a TDI `abort()` on a failed connection HOT 1
- Error reporting when using function mdsvalue in Matlab which version——stable_release-7-142-80 HOT 13
- Source repo contains obsolete public key for RPM packages
- Wrong number of child nodes in python TreeNode.getChildren()
- add timestamps, client ip & name, pid to mdsip error logs, equivalent to "access" logs HOT 1
- assign priorities to incoming mdsip connections
- intermittent failure to connect to MDSplus server
- enable linking MDSplus to custom python conda environments, and NOT system-wide python HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mdsplus.