barchart / barchart-feed-ddf

barchart data feed libraries
http://www.barchartmarketdata.com/solutions_datafeeds.php
4 stars 2 forks source link

Symbol list lookup fails for all symbols if one is not found #4

Closed mvberg closed 10 years ago

mvberg commented 10 years ago

Throws this uncatchable exception

java.lang.RuntimeException: java.lang.RuntimeException: com.barchart.feed.ddf.instrument.provider.SymbolNotFoundException: BADBADSYMBOL

Full trace: https://gist.github.com/mvberg/9102684

Run this to repo

final String[] instruments = new String[] { "GOOG", "MSFT", "YHOO", "BADBADSYMBOL" };

Iterator<Result<Instrument>> results = feed().instrument(instruments).toBlockingObservable().getIterator();

System.out.println("results has next = " + results.hasNext());

while (results.hasNext()) {
// fireworks happen here
System.out.println("Next = " + results.next().results().size());
}
mvberg commented 10 years ago

maybe this is by design, since I am doing toBlockingObservable - testing now with non blocking - will reopen if still an issue

mvberg commented 10 years ago

Nope, still happens when using subscribe, onError only fires

final String[] instruments = new String[] { "GOOG", "MSFT", "YHOO", "BADBADSYMBOL" };

        view.getMarketer().feed().instrument(instruments).subscribe(new Observer<Result<Instrument>>() {

            @Override
            public void onCompleted() {
                // TODO Auto-generated method stub

            }

            @Override
            public void onError(Throwable e) {
                System.out.println("list look up error, e = " + e);
            }

            @Override
            public void onNext(Result<Instrument> args) {
                System.out.println("on next = " + args.results().size());
            }

        });
cogmission commented 10 years ago

You need an intervening observable with a Func that handles "onError", then call toBlocking... on that maybe?? Hmmm...

Sent from my iPhone

On Feb 19, 2014, at 4:17 PM, Mike Ehrenberg notifications@github.com wrote:

Reopened #4.

— Reply to this email directly or view it on GitHub.

GLitchfield commented 10 years ago

Looking into it now

mvberg commented 10 years ago

fixed up, thanks.