-
Notifications
You must be signed in to change notification settings - Fork 31
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
throw error when variable not found #36
Comments
That was changed to ModelicaFormatMessage by purpose for #21 in the lack of any better ideas, see especially #21 (comment). There is a Boolean output argument signaling if a scalar variable is found or not. |
Reading my old commit message of bde9869 again I might change the message to ModelicaFormatWarning though. |
In |
You can workaround this use case by checking the output argument |
That indeed seems to be a valid workaround, but it is not that elegant (requires multiple lines of Modelica code). Is there something wrong with my suggestion? |
No, nothing wrong, except that I'd make it an enumertaion argument with values "No message", "Debug message", "Warning message" and "Error message". The other point is that it will require quite some time to do it in a consistent way for all functions provided by ExternData. |
Let's see if I can help out.. If you can make a prototype implementation then I can replicate it for all JSON functions? |
It is not only JSON, but let me think about it. |
I figured, but I rather not spend 10h on it either 😅 If the JSON ends up not being too much work then I might do all of them, but no promises there. |
Any update on this? :) |
I am surprised that the proposed workaround did not work out for you. Nevertheless, the diagnostic behaviour for missing data is a configuration parameter now. |
This works great, thanks a lot! |
The line
ExternData/ExternData/Resources/C-Sources/ED_JSONFile.c
Line 136 in 2fb7395
ModelicaFormatError
instead ofModelicaFormatMessage
, or at least provide this as an optional flag. Note that for arrays an error is already thrown:ExternData/ExternData/Resources/C-Sources/ED_JSONFile.c
Line 356 in 2fb7395
The text was updated successfully, but these errors were encountered: