Skip to content

Commit

Permalink
fix(remote)
Browse files Browse the repository at this point in the history
  • Loading branch information
hoc081098 committed Dec 12, 2022
1 parent bccd1e5 commit e771ad0
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
6 changes: 3 additions & 3 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ apply plugin: 'kotlin-android'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"

android {
compileSdkVersion flutter.compileSdkVersion
compileSdkVersion 33

compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
Expand All @@ -44,8 +44,8 @@ android {
defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId "com.hoc.node_auth"
minSdkVersion flutter.minSdkVersion
targetSdkVersion flutter.targetSdkVersion
minSdkVersion 21
targetSdkVersion 33
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
multiDexEnabled true
Expand Down
12 changes: 10 additions & 2 deletions lib/data/remote/api_service.dart
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,16 @@ class ApiService implements RemoteDataSource {
rethrow;
} on SocketException catch (e, s) {
throw RemoteDataSourceException('No internet connection', e, s);
} on SimpleHttpClientException catch (e, s) {
throw RemoteDataSourceException('Http error', e, s);
} on SimpleTimeoutException catch (e, s) {
throw RemoteDataSourceException('Timeout error', e, s);
} on SimpleErrorResponseException catch (e, s) {
String message;
try {
message = jsonDecode(e.errorResponseBody)['message'] as String;
} catch (_) {
message = 'Http error';
}
throw RemoteDataSourceException(message, e, s);
} catch (e, s) {
throw RemoteDataSourceException('Other error', e, s);
}
Expand Down

0 comments on commit e771ad0

Please sign in to comment.