FreeAndNil commented on PR #199:
URL: https://github.com/apache/logging-log4net/pull/199#issuecomment-2437146218

   > @FreeAndNil I'm wondering about two parts of the code. One is the:
   > 
   > ```cs
   >     catch
   >     {
   >       return null;
   >     }
   > ```
   > 
   > Should it really be the only place that doesn't fail back to 
`Environment.User`
   > 
   
   @fluffynuts you did the last meaningful change at this line in 
https://github.com/apache/logging-log4net/commit/e137855bdca5ed1a361c361846381607a5568d60
 WDYT?
   
   > and the second is the first if utilizing the flag:
   > 
   > ```cs
   >     if (_platformDoesNotSupportWindowsIdentity)
   >     {
   >       // we've already received one PlatformNotSupportedException or null 
from TryReadWindowsIdentityUserName
   >       // and it's highly unlikely that will change
   >       return Environment.UserName;
   >     }
   > ```
   > 
   > It is the only piece of code outside of the try block. It would be highly 
unfortunate to get an unhandled exception from it(based on impl details 
`Environment.UserName` can throw ). WDYT?
   
   We could catch errors and return NOTAVAILABLE.
   
   BTW I recently activated the .net analyzers in #201 and changed all the 
catch-alls, so please merge master.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to