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

Option for swallowing exceptions #72

Open
billrob opened this issue Sep 5, 2020 · 4 comments
Open

Option for swallowing exceptions #72

billrob opened this issue Sep 5, 2020 · 4 comments
Assignees

Comments

@billrob
Copy link

billrob commented Sep 5, 2020

I was using the nuget package currently out there and dumping some complex objects and where throwing an exception. I forked and coded out a SwallowException = true DumpOption, then noticed the default behavior has changed to swallowing and showing the exception message.

Could you get a new nuget package out? TIA

@thomasgalliker
Copy link
Owner

@billrob can you try the latest 3.x nuget?
https://www.nuget.org/packages/ObjectDumper.NET/3.0.20251.1

@billrob
Copy link
Author

billrob commented Sep 8, 2020

@thomasgalliker It is working as expected. However, since I did all the work, I just reversed the SwallowException to ThrowException as I can picture a time where a dev would WANT the error to be thrown especially if they are using the CSharp emitter to do some dynamic appDomain to RPC calls.

#74

@thomasgalliker
Copy link
Owner

Ah I just checked you change. Sure, we can „re-add“ such a configuration. Do you agree to keep it „safe“ by default (=catching the exception when GetValue() fails)?

I‘m busy this and next week, so it‘ll take some time to make its way into the next nuget :(

@billrob
Copy link
Author

billrob commented Sep 8, 2020

Yes, that is the default behavior to swallow and not blow up. ThrowException defaults to false and I do mention that in the xml comment on the property.

There is no rush on it as it behaves now like I want it to. I was dumping out an AD record from an LDAP query and some property was throwing a COM exception that I didn't care about. I wanted to see what was in the object on a system I didn't have debugging rights to.

But since I did the work, I just inverted it incase someone WANTED the exception to be thrown.

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

No branches or pull requests

2 participants