Reputation: 681
I have a website used by several person and only one person experiences a bug with a strange stacktrace :
System.FormatException: String was not recognized as a valid datetime. at System.DateTime.Parse(String s, IFormatProvider provider) at EditMandate.getFormData()`.
The strange thing is that there is no parse in the function getFormData
. This function uses functions which uses DateTime.Parse
but it doesn't use it directly.
Why stack trace shows function that is not directly called by my method?
Also, there is nothing strange in the string being parse as it worked several times and randomly crashed !
Upvotes: 0
Views: 91
Reputation: 679
If the problem arises with just one user, it's probably that person's culture settings on its local machine. Check if his settings have something weird (different date and time separators, 24H or 12H format and so on) and try to always standardize the datetime string you recieve from the client before parsing it.
Upvotes: 1
Reputation: 1502296
I suspect that:
DateTimeFormatInfo.ShortDatePattern
DateTime.Parse
Try to find anything which modifies cultures, or anything "different" about this person's machine.
Upvotes: 4