• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

icapps / flutter-template / 6543494175

17 Oct 2023 06:41AM UTC coverage: 61.294% (-0.04%) from 61.333%
6543494175

push

github

web-flow
Merge pull request #327 from icapps/#322-fix-nullability-in-errors

#322 fix nullability in errors

13 of 13 new or added lines in 7 files covered. (100.0%)

1080 of 1762 relevant lines covered (61.29%)

2.49 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

45.45
/lib/model/exceptions/un_authorized_error.dart
1
import 'dart:io';
2

3
import 'package:dio/dio.dart';
4
import 'package:flutter_template/util/locale/localization_keys.dart';
5
import 'package:icapps_architecture/icapps_architecture.dart';
6

7
class UnAuthorizedError extends NetworkError {
8
  static const statusCode = HttpStatus.unauthorized;
9

10
  UnAuthorizedError(
3✔
11
    super.dioException, {
12
    super.statusCodeValue,
13
  });
14

15
  @override
1✔
16
  String getLocalizedKey() => LocalizationKeys.errorUnauthorized;
17

18
  @override
×
19
  String? get getErrorCode {
20
    if (statusCodeValue == null) return '$statusCode';
×
21
    return '$statusCode [$statusCodeValue]';
×
22
  }
23

24
  static NetworkError parseError(DioException err) {
1✔
25
    final dynamic data = err.response?.data;
2✔
26
    if (data is! Map) return UnAuthorizedError(err);
2✔
27
    if (!data.containsKey('code')) return UnAuthorizedError(err);
×
28
    final code = data['code'] as String?;
×
29
    switch (code) {
30
      default:
31
        return UnAuthorizedError(err);
×
32
    }
33
  }
34
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc