Skip to content

Commit

Permalink
More debug logs for failed name/publish requests
Browse files Browse the repository at this point in the history
  • Loading branch information
livid committed Sep 14, 2024
1 parent 9df483f commit 866d019
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 2 deletions.
1 change: 1 addition & 0 deletions Planet/Entities/MyPlanetModel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -1792,6 +1792,7 @@ class MyPlanetModel: Equatable, Hashable, Identifiable, ObservableObject, Codabl
try KeychainHelper.shared.importKeyFromKeychain(forPlanetKeyName: id.uuidString)
}
let cid = try await IPFSDaemon.shared.addDirectory(url: publicBasePath)
debugPrint("Publishing the latest CID for \(name): \(cid)")
// Send the latest CID to dWebServices.xyz if enabled
if let dWebServicesEnabled = dWebServicesEnabled, dWebServicesEnabled,
let dWebServicesDomain = dWebServicesDomain, let dWebServicesAPIKey = dWebServicesAPIKey
Expand Down
4 changes: 4 additions & 0 deletions Planet/IPFS/IPFSDaemon.swift
Original file line number Diff line number Diff line change
Expand Up @@ -692,6 +692,10 @@ actor IPFSDaemon {
let httpResponse = response as? HTTPURLResponse,
httpResponse.ok
else {
if let errorDetails = String(data: data, encoding: .utf8) {
debugPrint("Failed to access IPFS API \(path): \(errorDetails)")
}
debugPrint("IPFS API Error: \(response)")
throw PlanetError.IPFSAPIError
}
// debugPrint the response
Expand Down
2 changes: 1 addition & 1 deletion Planet/Views/Sidebar/PlanetSidebarView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ struct PlanetSidebarView: View {
try await planet.publish()
}
catch {
debugPrint("Failed to publish: \(planet.name) id=\(planet.id)")
debugPrint("Failed to publish: \(planet.name) id=\(planet.id) error=\(error)")
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion Planet/versioning.xcconfig
Original file line number Diff line number Diff line change
@@ -1 +1 @@
CURRENT_PROJECT_VERSION = 2240
CURRENT_PROJECT_VERSION = 2241

0 comments on commit 866d019

Please sign in to comment.