-
Notifications
You must be signed in to change notification settings - Fork 2
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
CoSimualation (misspelling) causes exception #33
Comments
Yeah, it is a bit ugly. This is the XSD validation exception format. The problem is, I don't know the full set of exception messages I can get, so it's difficult to pick out the important bits to create a simpler error in general. If I just turn these into "XML validation failed" that would be useless. I'll try to find out whether the errors are actually more structured and predictable than they appear. |
Just to confirm, this is the same in the 1.1.3 VDMCheck tools, for much the same reason.
So currently, the FMI checking assumes that the input is a valid XML document according to the XSD. It does check this, but the error you get is "internal" - ie. fundamental. I'll see whether we can be smarter about this... |
So it looks like I could avoid the location details (though that is important), but otherwise the validation error is just an unstructured string, in this case:
|
Hmm I actually did run with 1.1.3 after the snapshot, but I must have stared myself blind (does that expression work in English as well?) and somehow did not notice the "internal error" marking that was added to 1.1.3. I think the internal error is fine. Don't remove the location 🙂 The different format makes it seem like it is a "tool" mistake, which it certainly is not. But honestly, it is a small thing. |
It also seems like this kind of error does not cause an exit code? |
So to summarize - So I think the script should have an non-zero exit code and still have the "Errors Found" on both occasions |
I agree that it really ought to say "Errors Found" and have an exit code. That should be easy to fix. I'm currently working on 1.1.4-SNAPSHOT. And "stared myself blind" does work in English, yes! |
This turns out to be quite a subtle problem. The VDMJ evaluation returns "true" or "false" as the overall result, and this is produced on stdout. But any error messages from The exception comes from the FMUReader, which is a VDMJ adapter that "opens" an FMU or XML file and produces a VDM-SL version of its contents. So I think, rather than complicating the scripts, the easiest way out of the will be to catch the validation error inside the FMUReader and use that to generate VDM-SL which contains an error indicator. Then the VDM validation function can test that flag and fail (return false) in the usual way, which should then treat these errors the same way as logical rule failures. |
Phew! Well, that was trickier than I thought, but I think it's a good solution. The FMUReader now creates a
The change is pushed to 1.1.4-SNAPSHOT. |
Can we close this one now? |
I understand the problem, but the reporting of this error is very different than the "regular" reporting of errors.
So I am thinking that this should be converted to the "normal" error reporting similar to
?
The text was updated successfully, but these errors were encountered: