Repository navigation
Localize user-facing error messages; log developer details - #82
Merged
Merged
Conversation
What the user sees is now in the app language, with the iOS wording; the error codes are unchanged: - 2002 with no response (IOException) or an error status without a message: "Something went wrong while communicating with the server. Please try again later." - 2002 for a response the app could not process, and 1001: "An unexpected error occurred." - 2001 and devise's message: the server's message as is, without " [Status: nnn]" or "Processing error: ". The raw detail and HTTP status stay in Throwable.message and are logged with the code where the error is made (ApiException.logged(), tag ApiError). ErrorMessages resolves the strings with the application Context installed in Application.onCreate, since most errors are made without a Context. AGENTS.md: user-facing error text is localized; developer details go to logs; NATIVEAPPTEMPLATE-nnnn codes stay untranslated. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01K5hZEFqXhBsUQwSWsgR6eH
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.
Summary
User-facing
CodedErrortext is now localized (en/ja, same wording as NativeAppTemplate-Free-iOS); developer details go to the log. Error codes are unchanged.NATIVEAPPTEMPLATE-2002Processing error: Unable to resolve host …/Processing error: HTTP 5022002;1001Processing error: …/Unexpected error: …error_message—2001<message> [Status: 422]<message>(status logged)2002Processing error: <message><message>ApiException.UnprocessableError.userMessage(Server/CommunicationFailure/Unexpected) says which one a 2002 is.ErrorMessagesresolves the strings with the application Context installed first thing inApplication.onCreate(errors are mostly made in the network layer without a Context). Resolved when read, so it follows the app language.ApiException.logged()logs[code] <raw detail> (HTTP status)where the error is made (adb logcat -s ApiError).NATIVEAPPTEMPLATE-nnnncodes stay untranslated. CHANGELOG updated.Test plan
CodedErrorTest(now Robolectric, incl.jaqualifier),ApiResponseExtensionsTest,LoginRepositoryImplTest,RepositoryRequestsTest,SignInEmailAndPasswordViewModelTest,ShopkeeperEditViewModelTest,TestErrors; seen red by breaking the string mapping, the IOException check, the status suffix and the devise mappingscripts/pre-pushpasses (406 unit tests)localhost:8767viaadb reverse: nothing listening →[NATIVEAPPTEMPLATE-2002] サーバーとの通信中に問題が発生しました。…; a fake server answering 200 with non-JSON →[NATIVEAPPTEMPLATE-2002] 予期しないエラーが発生しました。. Normal build against the local API: wrong password →[NATIVEAPPTEMPLATE-2001] メールアドレスまたはパスワードが正しくありません。もう一度お試しください。(no " [Status: 401]"), then signed in.🤖 Generated with Claude Code
https://claude.ai/code/session_01K5hZEFqXhBsUQwSWsgR6eH