whatadewitt / yahoo-fantasy-sports-api

NodeJS wrapper for the Yahoo! Fantasy Sports API
https://yahoo-fantasy-node-docs.vercel.app/
MIT License
200 stars 54 forks source link

application crashes on performing game.fetch #26

Closed anandkumary closed 7 years ago

anandkumary commented 7 years ago

Newbie to node.js & loved working on your framework. While trying to fetch few games details application crash's. Application crashes when trying to fetch the MMA game info.

Request

yf.games.fetch( 'mma', function(err,data) {

console.log("err ====" + err);
console.log("data ====" + data);

}

crashes asking

y/node_modules/yahoo-fantasy/index.js:72 data.error.reason = String(data.error.description).match( /"(.*?)"/ )[1];

TypeError: Cannot read property '1' of null

whatadewitt commented 7 years ago

Hmmm... this is certainly an error I should handle better, but Yahoo!'s API currently only supports the 4 majors sport leagues (to my knowledge): MLB, NFL, NHL and NBA.

whatadewitt commented 7 years ago

I'm going to close this as it isn't supported.

anandkumary commented 7 years ago

My concern is, it should not crash. At least it should show error.

On Sat, Nov 26, 2016 at 1:10 AM, Luke DeWitt notifications@github.com wrote:

I'm going to close this as it isn't supported.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/whatadewitt/yfsapi/issues/26#issuecomment-263015107, or mute the thread https://github.com/notifications/unsubscribe-auth/AMta5RvVjPScCMrRnUrfPLigCMrU_8HHks5rBzmYgaJpZM4K3azQ .

-- Thanks & Regards Anand Kumar Y N http://thekeywordacademy.com/coaching/1635.html

whatadewitt commented 7 years ago

Hmm... my sandbox app is handling errors fine when I enter MMA... what is the use case that you're experiencing this with?

anandkumary commented 7 years ago

Hi Luke,

When I enter tennis,cricket or any other sports name which does not support its crashed.

-anand

On Mon, Nov 28, 2016 at 7:10 AM, Luke DeWitt notifications@github.com wrote:

Hmm... my sandbox app is handling errors fine when I enter MMA... what is the use case that you're experiencing this with?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/whatadewitt/yfsapi/issues/26#issuecomment-263164959, or mute the thread https://github.com/notifications/unsubscribe-auth/AMta5U9yDbDpnpGy6PliI16tH4Zg5hyUks5rCjDzgaJpZM4K3azQ .

-- Thanks & Regards Anand Kumar Y N http://thekeywordacademy.com/coaching/1635.html

whatadewitt commented 7 years ago

I am... so dumb... the error I was seeing was because I hadn't logged in. I will fix this ASAP.