From e9d188ba3a53a815a50e8302e6282862406405d7 Mon Sep 17 00:00:00 2001 From: Edoardo La Greca Date: Thu, 7 Aug 2025 20:11:32 +0200 Subject: move UnresolvableHostException to except package --- src/main/kotlin/Connection.kt | 2 +- src/main/kotlin/TransportLayer.kt | 6 +++--- src/main/kotlin/UnresolvableHostException.kt | 6 ------ src/main/kotlin/except/UnresolvableHostException.kt | 8 ++++++++ 4 files changed, 12 insertions(+), 10 deletions(-) delete mode 100644 src/main/kotlin/UnresolvableHostException.kt create mode 100644 src/main/kotlin/except/UnresolvableHostException.kt (limited to 'src/main') diff --git a/src/main/kotlin/Connection.kt b/src/main/kotlin/Connection.kt index 911cb93..cde7863 100644 --- a/src/main/kotlin/Connection.kt +++ b/src/main/kotlin/Connection.kt @@ -15,7 +15,7 @@ import java.math.BigInteger * * @param transLay The networking API backend of choice. * - * @throws UnresolvableHostException if the host resolution made by [transLay] failed. + * @throws except.UnresolvableHostException if the host resolution made by [transLay] failed. */ class Connection(transLay: TransportLayer) : ProtocolTranslator { /** diff --git a/src/main/kotlin/TransportLayer.kt b/src/main/kotlin/TransportLayer.kt index 8778592..bdfc04e 100644 --- a/src/main/kotlin/TransportLayer.kt +++ b/src/main/kotlin/TransportLayer.kt @@ -6,9 +6,9 @@ import java.io.Closeable * to send and receive network messages (also called "payloads"). * * The address of the remote endpoint can be an IP address (v4 or v6) or a domain name, in which case it is resolved to - * an IP address right before initializing the connection. Every constructor should throw an [UnresolvableHostException] - * if the remote address is formatted as an actual domain name, but it cannot be resolved (e.g. it doesn't exist, or it - * contains forbidden characters). + * an IP address right before initializing the connection. Every constructor should throw an + * [except.UnresolvableHostException] if the remote address is formatted as an actual domain name, but it cannot be + * resolved (e.g. it doesn't exist, or it contains forbidden characters). * * Depending on the specific given implementation, the constructor of this class might throw other exceptions (e.g. the * [java.net.Socket] constructor in [TransportLayerJavaNet]). diff --git a/src/main/kotlin/UnresolvableHostException.kt b/src/main/kotlin/UnresolvableHostException.kt deleted file mode 100644 index 2a0624e..0000000 --- a/src/main/kotlin/UnresolvableHostException.kt +++ /dev/null @@ -1,6 +0,0 @@ -/** - * The specified domain, which identifies the host's address, could not be resolved. - * - * @param address The unresolvable address. - */ -class UnresolvableHostException(val address: String) : Exception("Hostname $address unresolvable.") \ No newline at end of file diff --git a/src/main/kotlin/except/UnresolvableHostException.kt b/src/main/kotlin/except/UnresolvableHostException.kt new file mode 100644 index 0000000..19dd3b6 --- /dev/null +++ b/src/main/kotlin/except/UnresolvableHostException.kt @@ -0,0 +1,8 @@ +package except + +/** + * The specified domain, which identifies the host's address, could not be resolved. + * + * @param address The unresolvable address. + */ +class UnresolvableHostException(val address: String) : Exception("Hostname $address unresolvable.") \ No newline at end of file -- cgit v1.2.3