Skip to content

Commit

Permalink
Show error message when trying to load track with 'snap-to-roads' fun…
Browse files Browse the repository at this point in the history
…ction but data is not available from third-party provider
  • Loading branch information
vitalidze committed May 10, 2016
1 parent d991079 commit 5032e59
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -246,13 +246,13 @@ public void onResponseReceived(Request request, Response response) {
snappedTracks.put(device.getId(), snappedTrack);
showArchive(device);
} else {
GWT.log("Incorrect response code: " + response.getStatusCode());
new AlertMessageBox(i18n.error(), i18n.errSnapToRoads(response.getStatusCode(), response.getText())).show();
}
}

@Override
public void onError(Request request, Throwable exception) {
GWT.log("Request error", exception);
new AlertMessageBox(i18n.error(), i18n.errSnapToRoads(-1, exception.getLocalizedMessage())).show();
}
});
} catch (RequestException re) {
Expand Down
2 changes: 2 additions & 0 deletions src/main/java/org/traccar/web/client/i18n/Messages.java
Original file line number Diff line number Diff line change
Expand Up @@ -550,4 +550,6 @@ String defaultNotificationTemplate(@Select DeviceEventType type,
String showOdometer();

String matchServiceURL();

String errSnapToRoads(int code, String text);
}
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ loadingData = Loading...
errNoResults = No results found for selected period
errFillFields = All form fields must be filled first
errNoDeviceNameOrId = Please fill both name and unique identifier fields
errSnapToRoads = Error loading track snapped to roads ({0}): {1}
# archive column headers
valid = Valid
time = Time
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ loadingData = Загрузка...
errNoResults = В выбранном периоде нет записей
errFillFields = Все поля должны быть заполнены
errNoDeviceNameOrId = Пожалуйста введите имя и уникальный код
errSnapToRoads = Ошибка загрузки точек с привязкой к дорогам ({0}): {1}
# archive column headers
valid = Правильно
time = Время
Expand Down

0 comments on commit 5032e59

Please sign in to comment.