Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

chore: reduce error verbosity#79

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
ethanndickson merged 2 commits intomainfromethan/reduce-err-verbosity
Feb 27, 2025
Merged
Show file tree
Hide file tree
Changes fromall commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletionCoder Desktop/Coder Desktop/Views/LoginForm.swift
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -201,7 +201,7 @@ enum LoginError: Error {
case .invalidURL:
"Invalid URL"
case let .failedAuth(err):
"Could not authenticate with Coder deployment:\n\(err.description)"
"Could not authenticate with Coder deployment:\n\(err.localizedDescription)"
}
}

Expand Down
2 changes: 1 addition & 1 deletionCoder Desktop/CoderSDK/Client.swift
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -131,7 +131,7 @@ public enum ClientError: Error {
case let .unexpectedResponse(data):
"Unexpected or non HTTP response: \(data)"
case let .encodeFailure(error):
"Failed to encode body: \(error)"
"Failed to encode body: \(error.localizedDescription)"
}
}

Expand Down
12 changes: 6 additions & 6 deletionsCoder Desktop/VPN/Manager.swift
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -251,17 +251,17 @@ enum ManagerError: Error {
var description: String {
switch self {
case let .download(err):
"Download error: \(err)"
"Download error: \(err.localizedDescription)"
case let .tunnelSetup(err):
"Tunnel setup error: \(err)"
"Tunnel setup error: \(err.localizedDescription)"
case let .handshake(err):
"Handshake error: \(err)"
"Handshake error: \(err.localizedDescription)"
case let .validation(err):
"Validation error: \(err)"
"Validation error: \(err.localizedDescription)"
case .incorrectResponse:
"Received unexpected response over tunnel"
case let .failedRPC(err):
"Failed rpc: \(err)"
"Failed rpc: \(err.localizedDescription)"
case let .serverInfo(msg):
msg
case let .errorResponse(msg):
Expand All@@ -273,7 +273,7 @@ enum ManagerError: Error {
case .permissionDenied:
"Permission was not granted to execute the CoderVPN dylib"
case let .tunnelFail(err):
"Failed to communicate with dylib over tunnel: \(err)"
"Failed to communicate with dylib over tunnel: \(err.localizedDescription)"
}
}

Expand Down
2 changes: 1 addition & 1 deletionCoder Desktop/VPN/TunnelHandle.swift
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -75,7 +75,7 @@ enum TunnelHandleError: Error {

var description: String {
switch self {
case let .pipe(err): "pipe error: \(err)"
case let .pipe(err): "pipe error: \(err.localizedDescription)"
case let .dylib(d): d
case let .symbol(symbol, message): "\(symbol): \(message)"
case let .openTunnel(error): "OpenTunnel: \(error.message)"
Expand Down
8 changes: 4 additions & 4 deletionsCoder Desktop/VPNLib/Download.swift
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -116,7 +116,7 @@ public func download(src: URL, dest: URL, urlSession: URLSession) async throws(D
do {
(tempURL, response) = try await urlSession.download(for: req)
} catch {
throw .networkError(error)
throw .networkError(error, url: src.absoluteString)
}
defer {
if FileManager.default.fileExists(atPath: tempURL.path) {
Expand DownExpand Up@@ -155,15 +155,15 @@ func etag(data: Data) -> String {
public enum DownloadError: Error {
case unexpectedStatusCode(Int)
case invalidResponse
case networkError(any Error)
case networkError(any Error, url: String)
case fileOpError(any Error)

public var description: String {
switch self {
case let .unexpectedStatusCode(code):
"Unexpected HTTP status code: \(code)"
case let .networkError(error):
"Network error: \(error.localizedDescription)"
case let .networkError(error, url):
"Network error: \(url) - \(error.localizedDescription)"
case let .fileOpError(error):
"File operation error: \(error.localizedDescription)"
case .invalidResponse:
Expand Down
Loading

[8]ページ先頭

©2009-2025 Movatter.jp