Skip to content
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

Error sending message: Type 'HomeSeer.Jui.Views.InvalidValueForTypeException' in Assembly 'PluginSdk' is not marked as serializable. #129

Closed
alexbk66 opened this issue Dec 18, 2020 · 5 comments
Labels
Bug A problem which impairs or prevents the functions of the product

Comments

@alexbk66
Copy link

alexbk66 commented Dec 18, 2020

Environment and System Config

  • OS: N/A
  • Language: C#
  • IDE: N/A
  • HomeSeer Version: [v4.1.10.0]
  • PluginSDK Version: [v1.2.1.0]

Describe the issue
All Exceptions thrown during processing requests from HS should be marked Serializable

Steps to Reproduce
Cause any exception, i.e. create an InputView(EInputType.Url) and pass string which is not a url

Expected behavior
The exception should be displayed to user

@spudwebb
Copy link
Collaborator

spudwebb commented Dec 21, 2020

Did you try to mark the exception as serializable and if so, was it then displayed to the user?
I think this issue is more complicated than that, and the underlying problem is that exceptions (even if marked Serializable) are not propagated through HSCF, Tracked as HS-1083.

HomeSeer Version: [v4.0.0.30]
PluginSDK Version: [v1.0.6.0]

are you really testing with those versions ? if so you should update.

@alexbk66
Copy link
Author

No, I'm on latest versions, sorry, that's default when you create an issue
HomeSeer Version: [v4.1.10.0]
PluginSDK Version: [v1.2.1.0]

@spudwebb spudwebb added Bug A problem which impairs or prevents the functions of the product In Review and removed Feedback labels Dec 22, 2020
@spudwebb
Copy link
Collaborator

It turns out we need to mark the exception Serializable and add a special constructor for HSCF to be able to deserialize it:

protected InvalidValueForTypeException(SerializationInfo info, StreamingContext context) : base(info, context) { }'

I fixed it as part of PSDK-117. It should be in the next SDK release.

@alexbk66
Copy link
Author

Thank you. I tried to mark the exception Serializable - then the error isn't shown at all, but at least the plugin doesn't crash.
I added exception handler and instead of displaying the offending view - I add a lable with the error info. Do you have mechanism for displaying errors in the settings pages?

@spudwebb
Copy link
Collaborator

Fixed in Plugin SDK version 1.2.2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug A problem which impairs or prevents the functions of the product
Projects
None yet
Development

No branches or pull requests

2 participants