@@ -372,21 +372,37 @@ public async Task<IntradayData> GetIntraDayTimeSeriesAsync(IntradayResourceType
372372 dayAndStartTime . Day == dayAndStartTime . Add ( intraDayTimeSpan ) . Day ) //adding the timespan doesn't go in to the next day
373373 {
374374 apiCall = string . Format ( "/1/user/-{0}/date/{1}/1d/time/{2}/{3}.json" ,
375- timeSeriesResourceType . GetStringValue ( ) ,
376- dayAndStartTime . ToFitbitFormat ( ) ,
377- dayAndStartTime . ToString ( "HH:mm" ) ,
378- dayAndStartTime . Add ( intraDayTimeSpan ) . ToString ( "HH:mm" ) ) ;
375+ timeSeriesResourceType . GetStringValue ( ) ,
376+ dayAndStartTime . ToFitbitFormat ( ) ,
377+ dayAndStartTime . ToString ( "HH:mm" ) ,
378+ dayAndStartTime . Add ( intraDayTimeSpan ) . ToString ( "HH:mm" ) ) ;
379379 }
380380 else //just get the today data, there was a date specified but the timerange was likely too large or negative
381381 {
382382 apiCall = string . Format ( "/1/user/-{0}/date/{1}/1d.json" ,
383- timeSeriesResourceType . GetStringValue ( ) ,
384- dayAndStartTime . ToFitbitFormat ( ) ) ;
383+ timeSeriesResourceType . GetStringValue ( ) ,
384+ dayAndStartTime . ToFitbitFormat ( ) ) ;
385385 }
386386
387387 apiCall = FitbitClientHelperExtensions . ToFullUrl ( apiCall ) ;
388388
389- HttpResponseMessage response = await HttpClient . GetAsync ( apiCall ) ;
389+ HttpResponseMessage response = null ;
390+ try
391+ {
392+ response = await HttpClient . GetAsync ( apiCall ) ;
393+ }
394+ catch ( FitbitRequestException fre )
395+ {
396+ if ( fre . ApiErrors . Any ( err => err . Message == Constants . FloorsUnsupportedOnDeviceError ) )
397+ {
398+ return null ;
399+ }
400+ else
401+ {
402+ //otherwise, rethrow because we only want to alter behavior for the very specific case above
403+ throw ;
404+ }
405+ }
390406 await HandleResponse ( response ) ;
391407 string responseBody = await response . Content . ReadAsStringAsync ( ) ;
392408
0 commit comments