ios widget showing what is available at chucks
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

feat: dont swallow error

+5 -5
+4 -4
Shared/ChucksShared.swift
··· 325 325 do { 326 326 menu = try JSONDecoder().decode(MenuResponse.self, from: data) 327 327 } catch { 328 - throw ChucksError.decodingError 328 + throw ChucksError.decodingError(underlying: error) 329 329 } 330 330 cachedMenu = menu 331 331 cacheDate = Date() ··· 359 359 public enum ChucksError: Error, LocalizedError, Sendable { 360 360 case invalidURL 361 361 case networkError 362 - case decodingError 362 + case decodingError(underlying: Error) 363 363 364 364 public nonisolated var errorDescription: String? { 365 365 switch self { ··· 367 367 return "Invalid URL" 368 368 case .networkError: 369 369 return "Network error" 370 - case .decodingError: 371 - return "Failed to parse menu data" 370 + case .decodingError(let underlying): 371 + return "Failed to parse menu data: \(underlying.localizedDescription)" 372 372 } 373 373 } 374 374 }
+1 -1
wasup-chucks/ContentView.swift
··· 566 566 } 567 567 568 568 #Preview("Error - Decoding") { 569 - ErrorCard(error: ChucksError.decodingError) {} 569 + ErrorCard(error: ChucksError.decodingError(underlying: NSError(domain: "Preview", code: 0, userInfo: [NSLocalizedDescriptionKey: "Sample decoding error"]))) {} 570 570 .padding() 571 571 }