Friendly loading-error messages + rotating debug log - #9
Merged
Conversation
Loading failures surfaced technical text straight from APIError (e.g. "Decoding ListRowDTO failed: …"). APIError.errorDescription now returns a new userFacingMessage — friendly copy for the client-only cases (decoding/transport/bare status), with server-written 4xx messages preserved verbatim. The technical form stays in .description for logs, so every existing error banner improves with no view edits. Adds AppLog (facade over os.Logger) + a rotating FileLog that writes to Library/Logs/InterlinedList/interlinedlist.log inside the app container. APIClient logs the full technical cause — request path plus the complete DecodingError coding path — at each decode/transport/ non-2xx failure; the user only ever sees the friendly banner. Tests: APIError user-facing vs. technical split, FileLog write + rotation, and a test-isolation guard so unit runs never touch the real ~/Library. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Loading failures were showing raw technical text from
APIError(e.g. "Decoding ListRowDTO failed: keyNotFound…"). This makes the UI friendly and moves the technical detail into a retrievable debug-log file.User-facing messages (fix at the error type)
APIError.errorDescription(→localizedDescription, which every error banner already reads) now returns a newuserFacingMessage— friendly copy for the client-only cases (decoding/transport/ bare status codes). Server-written 4xx messages (e.g. "Email not verified") are preserved verbatim..description(used only for logs). Net effect: every existing banner improves with no view-file edits.Debug log in the app's folder
AppLog(facade overos.Logger) + rotatingFileLog→~/Library/Containers/com.interlinedlist.macos/Data/Library/Logs/InterlinedList/interlinedlist.log(5 MB rotation, one.1backup).APIClientlogs the full technical cause — request path + completeDecodingErrorcoding path — at every decode / transport / non-2xx failure. The user only ever sees the friendly banner.Example log line produced end-to-end:
Testing
XCTestCaseruntime (SwiftPM omitsXCTestConfigurationFilePath) so unit runs never write to the real~/Library.** BUILD SUCCEEDED **).Notes
APIClient(all network/decoding errors); domain errors were already friendly.🤖 Generated with Claude Code