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

Problem with Exception types #23

Closed
hammett opened this issue Mar 6, 2014 · 2 comments
Closed

Problem with Exception types #23

hammett opened this issue Mar 6, 2014 · 2 comments

Comments

@hammett
Copy link

hammett commented Mar 6, 2014

Create or Pack with a class that has a reference to System.Exception will cause the following:

Unhandled Exception: System.Runtime.Serialization.SerializationException: Member
'HResult' is read only and its elementType ('System.Int32') is not an appendabl
e collection
at MsgPack.Serialization.AbstractSerializers.SerializerBuilder3.EmitSetMembe rValueStatement(TContext context, TConstruct instance, MemberInfo member, TConst ruct value) at MsgPack.Serialization.AbstractSerializers.SerializerBuilder3.<>c__Display
Class69.b__65(TConstruct unpackedItem)
at MsgPack.Serialization.AbstractSerializers.SerializerBuilder3.<EmitUnpackI temValueExpressionCore>d__1e.MoveNext() at System.Linq.Buffer1..ctor(IEnumerable1 source) at System.Linq.Enumerable.ToArray[TSource](IEnumerable1 source)
at MsgPack.Serialization.EmittingSerializers.ILEmittingSerializerBuilder2.Em itSequentialStatements(TContext context, Type contextType, IEnumerable1 stateme
nts)
at MsgPack.Serialization.AbstractSerializers.SerializerBuilder3.<EmitObjectU npackFromArrayCore>d__6b.MoveNext() at System.Linq.Buffer1..ctor(IEnumerable1 source) at System.Linq.Enumerable.ToArray[TSource](IEnumerable1 source)
at MsgPack.Serialization.EmittingSerializers.ILEmittingSerializerBuilder2.Em itSequentialStatements(TContext context, Type contextType, IEnumerable1 stateme
nts)
...

@yfakariya
Copy link
Member

Hi hammett. Thank you for your detailed reporting!

Unfortunately, MsgPack for CLI does not support to (de)serialize Exception because it is difficult to do perfectly. Could you use alternative class which stores information you want (such as type, message, stacktrace string).

Btw, I am very interested in why you want to serialize Exception.
Would you tell me why did you try to do?

@hammett
Copy link
Author

hammett commented Mar 8, 2014

Nevermind. We switched to protobuff.

We are using it to remote calls using 0mq. We do need to serialize exception information.

Thx

Sent from my iPhone

On Mar 8, 2014, at 12:24 AM, Yusuke Fujiwara notifications@github.com wrote:

Hi hammett. Thank you for your detailed reporting!

Unfortunately, MsgPack for CLI does not support to (de)serialize Exception because it is difficult to do perfectly. Could you use alternative class which stores information you want (such as type, message, stacktrace string).

Btw, I am very interested in why you want to serialize Exception.
Would you tell me why did you try to do?


Reply to this email directly or view it on GitHub.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants