-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathExe5Main.java
More file actions
22 lines (20 loc) · 843 Bytes
/
Exe5Main.java
File metadata and controls
22 lines (20 loc) · 843 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
package exercicio5;
public class Exe5Main {
public static void main(String[] args) {
Exe5HttpClient client = new Exe5HttpClient();
String url = "https://api.example.com/data";
try {
String response = client.sendRequest(url);
client.parseResponse(response);
System.out.println("Request completed successfully!");
} catch (HttpException e) {
System.err.println("HTTP Error: " + e.getMessage());
} catch (HttpResponseException e) {
System.err.println("Server Response Error: " + e.getMessage());
} catch (DeserializationException e) {
System.err.println("Parsing Error: " + e.getMessage());
} catch (Exception e) {
System.err.println("Unexpected error: " + e.getMessage());
}
}
}