-
Notifications
You must be signed in to change notification settings - Fork 21
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
"uncaught exception: Cannot convert undefined or null to object" at fronius restart #313
Comments
There i need to think how to handle cases where somewhere in the middle of the process the object is not delivering the expected values. @mcm1957 do you think we should issue an error log or just a warning log for such catched errors? |
Depends on the situation: If this is a situation which can occure in normal operation, neither warning nur error is needed. In most cases even no try/catch will be necessary then but a normal if (obj && obj.element ...) or even ... obj?.element... code sequence will do it and either some action will be skipped or processed with a default value. If the situation is really unexpected (i.e. the fronius reports the voltage of 2 phases but the third phase is missing in response) logging a warning should be ok. This would allow the user to (tempory) change logging to error if the warnings are too often while the overall operation is still ok. If the adapter need to terminate / restart / drop the connection and reinitialize itself or cannot do any useful operation an erro will be OK.
If you have the situation where the system sends an answerblock but some data is missing you could evaluate whether ist acceptable to simple set the states to null (and optionally set a siutable q flag) indicating "well - fronius did not send currentz power value ...") |
Part of Release 2.0.2 |
Adapter crashes at restart of fronius system:
An exception stating problems would be OK, a crash must be avoided.
Detail log see comments at forum:
The text was updated successfully, but these errors were encountered: