diff --git a/app/src/main/java/com/example/citrusclient/viewmodels/TodosViewModel.java b/app/src/main/java/com/example/citrusclient/viewmodels/TodosViewModel.java index 79e9411..722398e 100644 --- a/app/src/main/java/com/example/citrusclient/viewmodels/TodosViewModel.java +++ b/app/src/main/java/com/example/citrusclient/viewmodels/TodosViewModel.java @@ -67,7 +67,7 @@ } @Override public void onFailure(Call>>>> call, Throwable t) { - System.out.println("UnknownError: getAllTodos" + t); + System.out.println("CommunicationError: getAllTodos" + t); errorLiveData.setValue(parseStatusCode(-1)); } @@ -90,7 +90,7 @@ } @Override public void onFailure(Call>> call, Throwable t) { - System.out.println("UnknownError: getTodosByMonth" + t); + System.out.println("CommunicationError: getTodosByMonth" + t); errorLiveData.setValue(parseStatusCode(-1)); } @@ -113,7 +113,7 @@ } @Override public void onFailure(Call> call, Throwable t) { - System.out.println("UnknownError: getTodosByDay" + t); + System.out.println("CommunicationError: getTodosByDay" + t); errorLiveData.setValue(parseStatusCode(-1)); } @@ -136,7 +136,7 @@ } @Override public void onFailure(Call call, Throwable t) { - System.out.println("UnknownError: getTodoById" + t); + System.out.println("CommunicationError: getTodoById" + t); errorLiveData.setValue(parseStatusCode(-1)); } @@ -159,7 +159,7 @@ } @Override public void onFailure(Call call, Throwable t) { - System.out.println("UnknownError: createTodo" + t); + System.out.println("CommunicationError: createTodo" + t); errorLiveData.setValue(parseStatusCode(-1)); } @@ -182,7 +182,7 @@ } @Override public void onFailure(Call call, Throwable t) { - System.out.println("UnknownError: setCheck" + t); + System.out.println("CommunicationError: setCheck" + t); errorLiveData.setValue(parseStatusCode(-1)); } }); @@ -204,12 +204,14 @@ } @Override public void onFailure(Call call, Throwable t) { - System.out.println("UnknownError: deleteTodo" + t); + System.out.println("CommunicationError: deleteTodo" + t); errorLiveData.setValue(parseStatusCode(-1)); } }); } + + private String parseStatusCode(Integer stats) { switch (stats) { case 404: