Skip to content

fix: handle unexpected API responses - #80

Open
Likhithagandham wants to merge 1 commit into
NxtLabTech:mainfrom
Likhithagandham:fix/issue-12-description
Open

Likhithagandham wants to merge 1 commit into
NxtLabTech:mainfrom
Likhithagandham:fix/issue-12-description

Conversation

@Likhithagandham

Copy link
Copy Markdown

What changed?

  • Added handling for unexpected API responses, including HTML and invalid JSON.
  • Converted malformed response parsing errors into friendly ApiException messages.
  • Preserved backend error messages for failed API requests.
  • Added four tests covering HTML responses, invalid JSON, unexpected response types, and missing required fields.

Which issue does this address?

Closes #12

How was it tested?

  • flutter test – all 78 tests passed.
  • flutter test test/api_service_test.dart – all 8 tests passed.
  • flutter test test/session_list_screen_test.dart – all 9 tests passed.
  • flutter test test/join_queue_screen_test.dart – all 4 tests passed.
  • flutter analyze – no issues found.
  • git diff --check – passed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Handle unexpected API responses without leaving screens stuck

1 participant