BrianHumlicek / J2534-Sharp

A .Net interface for J2534 vehicle communications.
Other
43 stars 14 forks source link

Error when unknown result message is returned from device #37

Open prj opened 6 months ago

prj commented 6 months ago

If device returns an undefined error code, then the whole stack throws an exception.

System.InvalidOperationException: Sequence contains no elements
   at System.Linq.ThrowHelper.ThrowNoElementsException()
   at System.Linq.Enumerable.First[TSource](IEnumerable`1 source)
   at Common.EnumHelper.GetMemberDescription(Enum enumeration)
   at SAE.J2534.ResultCodeExtensions.GetDescription(ResultCode code)
   at SAE.J2534.J2534Exception..ctor(ResultCode Result, String Message)
   at SAE.J2534.API.CheckResult(ResultCode Result)
   at SAE.J2534.API.GetDevice(String DeviceName)
BrianHumlicek commented 5 months ago

I just noticed this. I’m surprised to see this happening as I’m sure that would have been a case I tested, but…. Are you using the latest J2534 Sharp?

Brian