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

Support Exception Propagation for .NET Core #102

Closed
pardahlman opened this issue Sep 4, 2016 · 2 comments
Closed

Support Exception Propagation for .NET Core #102

pardahlman opened this issue Sep 4, 2016 · 2 comments
Assignees
Labels
Milestone

Comments

@pardahlman
Copy link
Owner

Serialization in general, and of or Exception in particular is still an unresolved topic for .NET Core (https://github.com/dotnet/coreclr/issues/2715, https://github.com/dotnet/corefx/issues/6564). Until this issue is resolved, we should overlook how MessageHandlerException should be serialized and re-thrown for RPC.

@pardahlman pardahlman added this to the 1.10.0 milestone Sep 4, 2016
@pardahlman pardahlman self-assigned this Sep 4, 2016
@chrishaly
Copy link

it's very hardly to implements InnerException, StackTrace, Message etc. (de)serializable for json or xml.

I reveiwed the .NetCore Framework XmlSerializer it can serialize/deserialize InnerException, the method is use Reflection to access private fields. It's a very low level usage, private field is not contract and variable.

corefx\src\System.Private.DataContractSerialization\src\System\Runtime\Serialization\ExceptionDataContract.cs

            private static Dictionary<string, string> CreateExceptionFields()
            {
                var essentialExceptionFields = new Dictionary<string, string>(12);
                essentialExceptionFields.Add("_className", "ClassName");
                essentialExceptionFields.Add("_message", "Message");
                essentialExceptionFields.Add("_data", "Data");
                essentialExceptionFields.Add("_innerException", "InnerException");
                essentialExceptionFields.Add("_helpURL", "HelpURL");
                essentialExceptionFields.Add("_stackTraceString", "StackTraceString");
                essentialExceptionFields.Add("_remoteStackTraceString", "RemoteStackTraceString");
                essentialExceptionFields.Add("_remoteStackIndex", "RemoteStackIndex");
                essentialExceptionFields.Add("_exceptionMethodString", "ExceptionMethod");
                essentialExceptionFields.Add("_HResult", "HResult");
                essentialExceptionFields.Add("_source", "Source");
                essentialExceptionFields.Add("_watsonBuckets", "WatsonBuckets");
                return essentialExceptionFields;
            }

since Framework need to do like this why not support ISerializable?

@pardahlman
Copy link
Owner Author

Hi @chrishaly, thanks for the input! I did a somewhat similar discovery myself when looking into this. The ambition for 1.10.0 is to support netstandard1.5, and that is somewhat limiting to what can be done. Until there is a clean way to serialize exception for .NET Core, we'll have to do with the work-around in 3afb94d. Exception will be captured, metadata extracted and re-thrown in the Requester.

Let me know if you have any other suggestions for how to achieve this!

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

No branches or pull requests

2 participants