Add comprehensive error message parsing to prevent raw JSON display

- Created ErrorMessageParser utility for both iOS (Swift) and Android (Kotlin)
- Parser detects JSON-formatted error messages and extracts user-friendly text
- Identifies when data objects (not errors) are returned and provides generic messages
- Updated all API error handling to pass raw error bodies instead of concatenating
- Applied ErrorMessageParser across all ViewModels and screens on both platforms
- Fixed ContractorApi and DocumentApi to not concatenate error bodies with messages
- Updated ApiResultHandler to automatically parse all error messages
- Error messages now show "Request failed. Please check your input and try again." instead of raw JSON

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Trey t
2025-11-14 22:59:42 -06:00
parent 225bdbc2bc
commit 2730c94e4d
48 changed files with 415 additions and 265 deletions

View File

@@ -127,6 +127,10 @@ struct RegisterView: View {
}
)
}
.handleErrors(
error: viewModel.errorMessage,
onRetry: { viewModel.register() }
)
}
}
}