-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature/filename in error msg #39
Feature/filename in error msg #39
Conversation
@nate-moehring I love adding file/url source information to error messages. As I'm reviewing this, a question popped into my head about keeping related work together (cohesion) and I wondered if inserting the file path information at the same "level" as the file read would make sense. What are your thoughts about this? Related question: As a user of the JSON Deserializer how will I know what this new input does and how/when I should use it? (Asking because I didn't see mention in the VI Description nor was it apparent from the control name since path/url isn't data needed for parsing the JSON). |
Natural question, and I even stated essentially the same thing in my original email to you about this PR. (I thought it was in a comment field somewhere, but I guess not, my apologies.) I agree this is kind of breaking some SOLID rules, however, I have two reasons that motivated the change as is:
You're right, I should have said something about it in the VI Description of Unflatten From JSON String.vi, though I think I did put something in the Control's Description about it's use. |
fcd83cc
to
7151a3e
Compare
Hi @nate-moehring. Great points. I wonder if it would make sense to generalize the VI that appends file path/url the error string. Here's the direction of my thinking: This could be converted into a subVI that is then called by VIs that read or write the file, as such. Here's how this could be further improved(?) |
Wow, thanks for all the time you put into thinking about alternative implementations. I guess this is a good solution IF the new subvi is added to the palette.
This turns out not to be useful because the Write File primitive already includes the filename in the error, at least for some error codes... |
… it to Read Configuration.vi
Alright, I've made the requested changes. I also removed the wrapper tests VIs, because it seems like Caraya was not correctly auto-removing sub-tests from the list of discovered tests. Each test was getting run several times. The best code is no code, let the tool find the tests. I guess the .vipb is stored in an internal JKI repo? |
Did you see my email regarding a G Compiler? |
The .vipb is here: src/JSON Serialization.vipb If you're willing to do a test build and see if it works well, that would be great! |
Create new optional input for defining the source of the JSON String being parsed, so that the filename/URL can be inserted into the error message.
Changes error message from simply:
Internal\serror
to:
Internal error in <Source Path or URL>