Skip to main content
Glama
NetworkExceptions.kt1.45 kB
package xcuitest.api import java.io.IOException sealed class NetworkException(message: String) : IOException(message) { class TimeoutException(message: String) : NetworkException(message) class ConnectionException(message: String) : NetworkException(message) class UnknownHostException(message: String) : NetworkException(message) class UnknownNetworkException(message: String): NetworkException(message) companion object { private fun NetworkException.displayErrorMessage(): String { return when (this) { is TimeoutException -> "A timeout occurred while waiting for a response from the XCUITest server." is ConnectionException -> "Unable to establish a connection to the XCUITest server." is UnknownHostException -> "The host for the XCUITest server is unknown." is UnknownNetworkException -> "An unknown network error occurred while communicating with the XCUITest server." } + " If the issue persists, consider raising a GitHub issue with the error message and any available logs for further assistance." } fun NetworkException.toUserNetworkException(): NetworkErrorModel { return NetworkErrorModel( displayErrorMessage(), stackTraceToString() ) } } data class NetworkErrorModel(val userFriendlyMessage: String, val stackTrace: String) }

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/mobile-dev-inc/Maestro'

If you have feedback or need assistance with the MCP directory API, please join our Discord server