Skip to content

Commit

Permalink
Better error handling.
Browse files Browse the repository at this point in the history
  • Loading branch information
xunto committed Jan 1, 2022
1 parent b69693a commit 4e3394d
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -71,11 +71,13 @@ public void onResponse(Call call, Response response) throws IOException {
String responseData = responseBody.string();

if (response.code() == 404) {
throw new NotFound();
this.onFailure(call, new NotFound());
return;
}

if (!response.isSuccessful()) {
throw new UnknownResponse(response.code(), responseData);
this.onFailure(call, new UnknownResponse(response.code(), responseData));
return;
}

T result = AccountsClient.this.gson.fromJson(responseData, clazz);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ public CompletableFuture<GameObject> applyRemoteBinding(EntityPlayer player) {
username
);
} else {
TalesSystem.logger.error("Error while setting remote binding for.", e);
TalesSystem.logger.error("Error while setting remote binding.", e);
}

throw new CompletionException(e);
Expand Down
2 changes: 2 additions & 0 deletions src/main/resources/assets/tales_system/lang/en_us.lang
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,8 @@ cofd.range.medium=Medium
cofd.range.long=Long
cofd.range.extreme=Extreme

pw.tales.mod.error.generic=Unexpected error appeared. Contact server administrator.

command.range.wrong_usage=You need to select at least one entity.
command.range.from_unloaded=Starting point entity is unloaded.
command.range.to_unloaded=Ending point entity is unloaded.
2 changes: 2 additions & 0 deletions src/main/resources/assets/tales_system/lang/ru_ru.lang
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,8 @@ cofd.range.medium=Средняя
cofd.range.long=Дальняя
cofd.range.extreme=Огромная

pw.tales.mod.error.generic=Возникла ошибка. Сообщите администратору.

command.range.wrong_usage=Нужно выбрать хотя бы одну цель.
command.range.from_unloaded=Цель, выступающая начальной точкой, недоступна (выгружена).
command.range.to_unloaded=Цель, выступающая конечной точкой, недоступна (выгружена).

0 comments on commit 4e3394d

Please sign in to comment.