LiteDB icon indicating copy to clipboard operation
LiteDB copied to clipboard

String.FormatException in logger

Open Pyritie opened this issue 6 years ago • 1 comments

https://github.com/mbdavid/LiteDB/blob/373c5e56cca061af4fd9362ad92f728f889f7bfe/LiteDB/Utils/Logger.cs#L69

This line can throw an exception if the args are empty but if the message string contains a substring that looks like "{0}".

Changing this line to the following fixes this error:

var text = args != null ? string.Format(message, args) : message;

Pyritie avatar May 29 '18 15:05 Pyritie

https://github.com/mbdavid/LiteDB/blob/373c5e56cca061af4fd9362ad92f728f889f7bfe/LiteDB/Utils/Logger.cs#L69

This line can throw an exception if the args are empty but if the message string contains a substring that looks like "{0}".

Changing this line to the following fixes this error:

var text = args != null ? string.Format(message, args) : message;

The file 'Logger.cs' does not seem to exist anymore. However the issue you mentioned is found in the following file: FileException.cs You could say that this is proper behaviour since the expected arguments are not provided.

visschersm avatar May 17 '22 04:05 visschersm