mathpaquette / IQFeed.CSharpApiClient

IQFeed.CSharpApiClient is fastest and the most well-designed C# DTN IQFeed socket API connector available
MIT License
121 stars 42 forks source link

E,NO DATA should or should not be converted in exception? #1

Closed mathpaquette closed 6 years ago

Nucs commented 6 years ago

I would suggest wrapping the errors from iqfeed in their own exception class (let's say IQFeedException). Regarding "E,!NO_DATA!,", if you decide it should throw an exception instead of returning an empty array, you should wrap it in a separate/inherited exception from IQFeedException so it will be possible to distinguish it from IQFeedException in try/catch.

omencat commented 6 years ago

Just to add here, any lookups with symbols that begin with E (e.g., EOR) will throw a false positive exception.

As workaround in in ChainsMessageHandler.cs for example could be

// check for errors if (lines[0][0] == 'E' && lines[0][1] == ',')

omencat commented 6 years ago

Sorry, I just synced and noticed you already resolved that error pattern

mathpaquette commented 6 years ago

Yes I’ll push the code tonight I have it locally!

Sent from my iPhone

On Jul 12, 2018, at 6:31 PM, omencat notifications@github.com<mailto:notifications@github.com> wrote:

Sorry, I just synced and noticed you already resolved that error pattern

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/mathpaquette/IQFeed.CSharpApiClient/issues/1#issuecomment-404671085, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AEKBN4tPd7OZwHOscelt-H5QotFvBvOEks5uF85agaJpZM4Un8jp.

mathpaquette commented 6 years ago

No problem, thanks for raised it. I made a major cleanup/refactor and created custom IQFeed exceptions.

On Jul 12, 2018, at 6:31 PM, omencat notifications@github.com<mailto:notifications@github.com> wrote:

Sorry, I just synced and noticed you already resolved that error pattern

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/mathpaquette/IQFeed.CSharpApiClient/issues/1#issuecomment-404671085, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AEKBN4tPd7OZwHOscelt-H5QotFvBvOEks5uF85agaJpZM4Un8jp.

mathpaquette commented 6 years ago

please review guys

omencat commented 6 years ago

confirmed NoDataIQFeedException