diff --git a/sysagua-app/src/main/java/edu/pies/sysaguaapp/services/ClientesService.java b/sysagua-app/src/main/java/edu/pies/sysaguaapp/services/ClientesService.java index e626c98..11add69 100644 --- a/sysagua-app/src/main/java/edu/pies/sysaguaapp/services/ClientesService.java +++ b/sysagua-app/src/main/java/edu/pies/sysaguaapp/services/ClientesService.java @@ -33,13 +33,12 @@ public List buscarClientes(String token) throws Exception { return objectMapper.readValue(response.body(), new TypeReference>() { }); } else { - throw new Exception("Erro ao buscar clientes: " + response.body()); + throw new Exception("Erro ao buscar clientes: "); } } public static Clientes criarCliente(Clientes clientes, String token) throws Exception { String clienteJson = objectMapper.writeValueAsString(clientes); - System.out.println("Sending client data: " + clienteJson); HttpRequest request = HttpRequest.newBuilder() .uri(URI.create(BASE_URL)) @@ -63,10 +62,10 @@ public static Clientes criarCliente(Clientes clientes, String token) throws Exce } } else if (response.statusCode() == 400) { System.out.println("Erro ao criar cliente: " + response.body()); - throw new Exception("Erro ao criar cliente: " + response.body()); + throw new Exception("Erro ao criar cliente: "); } else { System.out.println("Server response: " + response.body()); - throw new Exception("Erro ao criar cliente: " + response.body()); + throw new Exception("Erro ao criar cliente: "); } } public static Clientes editarCliente(Clientes cliente, String token) throws Exception { @@ -88,11 +87,11 @@ public static Clientes editarCliente(Clientes cliente, String token) throws Exce try { return objectMapper.readValue(response.body(), Clientes.class); // Tenta converter a resposta para o objeto Cliente } catch (IOException e) { - throw new Exception("Erro ao processar a resposta do servidor: " + e.getMessage()); + throw new Exception("Erro ao processar a resposta do servidor: "); } } } else { - throw new Exception("Erro ao editar cliente: " + response.body()); + throw new Exception("Erro ao editar cliente: "); } } public static Clientes inativarCliente(Clientes cliente, String token) throws Exception { @@ -117,11 +116,11 @@ public static Clientes inativarCliente(Clientes cliente, String token) throws Ex try { return objectMapper.readValue(response.body(), Clientes.class); } catch (IOException e) { - throw new Exception("Erro ao processar a resposta do servidor: " + e.getMessage()); + throw new Exception("Erro ao processar a resposta do servidor: "); } } } else { - throw new Exception("Erro ao inativar cliente: " + response.body()); + throw new Exception("Erro ao inativar cliente: "); } }