Skip to content

Commit

Permalink
fix bug where it will tell users that port authority server is actual…
Browse files Browse the repository at this point in the history
…ly down and ready to push update
  • Loading branch information
epicstar committed Aug 22, 2016
1 parent f453f7c commit 764bc45
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
4 changes: 2 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ android {
applicationId "rectangledbmi.com.pittsburghrealtimetracker"
minSdkVersion 16
targetSdkVersion 23
versionCode 75
versionName "7.0.2"
versionCode 76
versionName "7.0.3"
}
lintOptions {
warning 'InvalidPackage'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -564,8 +564,9 @@ public Observable<RouteSelection> call(RouteSelection routeSelection) {
}).map(VehicleResponse::getBustimeResponse)
.retryWhen(attempt -> attempt
.flatMap(throwable -> {
Timber.d(throwable, "Catching error");
// theoretically, this should only resubscribe when internet is back
if (throwable instanceof IOException){
if (throwable instanceof IOException && !(throwable instanceof SocketTimeoutException)){
if (busListInteraction != null) {
busListInteraction.showToast(getString(R.string.disconnected_internet), Toast.LENGTH_SHORT);
}
Expand Down Expand Up @@ -606,7 +607,7 @@ public Observable<RouteSelection> call(RouteSelection routeSelection) {
// otherwise, just run normal onError
Timber.d("Not retrying since something should be wrong on " +
"Port Authority's end.");
return null;
return Observable.error(throwable);
}))
.share()
.subscribeOn(Schedulers.computation())
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -357,7 +357,7 @@
<string name="pat_api_exceeded">Port Authority server unavailable. Please try again after midnight.</string>
<string name="retrofit_network_error">Cannot connect to internet. Please check your data.</string>
<string name="retrofit_conversion_error">Cannot translate information from Port Authority.</string>
<string name="retrofit_http_error">The Port Authority website seems to be down.</string>
<string name="retrofit_http_error">Port Authority server is down. Please try again later.</string>
<string name="retrofit_unexpected_error">An unexpected error occurred. Please contact the
developers.
</string>
Expand Down

0 comments on commit 764bc45

Please sign in to comment.