Skip to content
This repository has been archived by the owner on Dec 8, 2018. It is now read-only.

Consider showing LoaderExceptions when caught exception is ReflectionTypeLoadException #315

Closed
pranavkm opened this issue Jul 8, 2016 · 7 comments

Comments

@pranavkm
Copy link
Contributor

pranavkm commented Jul 8, 2016

Based on discussion at aspnet/Mvc#4892 (comment). It would be nice to type load exceptions so that it's easier to figure out what went wrong rather than see a generic message that tells you to read LoaderExceptions

@pranavkm
Copy link
Contributor Author

pranavkm commented Jul 8, 2016

cc @Eilon \ @rynowak \ @halter73 \ @davidfowl

@pranavkm
Copy link
Contributor Author

pranavkm commented Jul 8, 2016

Are there other exception types that would benefit from a similar treatment? AggregateExceptions for instance?

@pranavkm
Copy link
Contributor Author

pranavkm commented Jul 8, 2016

Also @ajaybhargavb who's assigned this work :)

@halter73
Copy link
Member

halter73 commented Jul 8, 2016

If you wanted to be super generic you could think about some reflection based logging. Maybe JSON serialization. I haven't tried it out to see how it would look for ReflectionTypeLoadExceptions and AggregateExceptions, but it might be worth looking into.

@pranavkm
Copy link
Contributor Author

pranavkm commented Jul 8, 2016

Not sure I follow @halter73 - is this essentially serializing the exception to the log?

@halter73
Copy link
Member

Since this issue is filed in the diagnostics repo, I thought it would be about how to display exceptions in the error pages, not how it's logged. But yes, I'm essentially suggesting serializing the exception if it can be done in a way that's not too verbose/distracting. Maybe it can be put in a collapsible section like the result of Exception.ToString() is today.

I still think that MVC should catch ReflectionTypeLoadExceptions when it accesses Assembly.DefinedTypes and log it specially with LoaderExceptions like I suggest in aspnet/Mvc#4892 (comment).

@Eilon
Copy link
Member

Eilon commented Jul 18, 2016

@ajaybhargavb this is part of what we discussed earlier. Would be nice to special case some exception types and show more detailed information about them.

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

No branches or pull requests

4 participants