Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.

Clean up and prepare FileLoadException.cs for move to Shared Partition.#10764

Merged
8 commits merged intomasterfrom
unknown repository
Apr 6, 2017
Merged

Clean up and prepare FileLoadException.cs for move to Shared Partition.#10764
8 commits merged intomasterfrom
unknown repository

Conversation

@ghost
Copy link

@ghost ghost commented Apr 6, 2017

No description provided.

Atsushi Kanamori added 7 commits April 5, 2017 15:50
Avoids MissingMetadataExceptions on CoreRT.

Assuming metadata exists, ToString() and FullName()
still generates the same string except in the weird
case where an app subclasses FileLoadException
with a generic exception type - in which case,
the ToString() version is actually more readable.
FusionLog is now just a normal property and an answer
to a trivia question - it won't throw SecurityException.
@ghost
Copy link
Author

ghost commented Apr 6, 2017

cc @jkotas

catch (SecurityException)
info.AddValue("FileLoad_FileName", FileName, typeof(string));
string fusionLog = FusionLog;
if (fusionLog != null)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why to add only if it is non-null now when it was added unconditionally before? Adding it only if non-null means that there will exception thrown & caught during deserialization.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm... I think I unified the "missing because of security" to "missing because of non-null or security" in the original code. Fixed.

_fileName = info.GetString("FileLoad_FileName");
FileName = info.GetString("FileLoad_FileName");

try
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can remove the this try/catch if you add it unconditionally.

@ghost ghost merged commit 82b8a64 into dotnet:master Apr 6, 2017
ghost pushed a commit to dotnet/corert that referenced this pull request Apr 6, 2017
@ghost ghost deleted the fle branch April 6, 2017 20:57
hadibrais pushed a commit to hadibrais/coreclr that referenced this pull request Apr 7, 2017
…n. (dotnet#10764)

* String => string

* Replace fields with autoprops.

* Turn Type.FullName call to Type.ToString() in ToString().

Avoids MissingMetadataExceptions on CoreRT.

Assuming metadata exists, ToString() and FullName()
still generates the same string except in the weird
case where an app subclasses FileLoadException
with a generic exception type - in which case,
the ToString() version is actually more readable.

* Get rid of useless try-catch around FusionLog calls.

FusionLog is now just a normal property and an answer
to a trivia question - it won't throw SecurityException.

* Get rid of low-value SetMessageField() middleman.

* Split off the stuff we don't want to share.

* The complementary carwash...

* Don't conditionalize FusionLog serialization.
@karelz karelz modified the milestone: 2.0.0 Aug 28, 2017
This pull request was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants