Skip to content

Commit 65f624e

Browse files
committed
handle http ClientException
1 parent a3449f4 commit 65f624e

File tree

2 files changed

+7
-53
lines changed

2 files changed

+7
-53
lines changed

packages/dart/lib/parse_server_sdk.dart

Lines changed: 1 addition & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import 'dart:typed_data';
99
import 'package:collection/collection.dart';
1010
import 'package:cross_file/cross_file.dart';
1111
import 'package:dio/dio.dart';
12+
import 'package:http/http.dart';
1213
import 'package:meta/meta.dart';
1314
import 'package:mime/mime.dart';
1415
import 'package:path/path.dart' as path;
@@ -29,111 +30,58 @@ export 'src/network/parse_dio_client.dart';
2930
export 'src/network/parse_http_client.dart';
3031

3132
part 'src/base/parse_constants.dart';
32-
3333
part 'src/data/parse_core_data.dart';
34-
3534
part 'src/data/parse_subclass_handler.dart';
36-
3735
part 'src/enums/parse_enum_api_rq.dart';
38-
3936
part 'src/network/options.dart';
40-
4137
part 'src/network/parse_client.dart';
42-
4338
part 'src/network/parse_connectivity.dart';
44-
4539
part 'src/network/parse_live_query.dart';
46-
4740
part 'src/network/parse_query.dart';
48-
4941
part 'src/objects/parse_acl.dart';
50-
5142
part 'src/objects/parse_array.dart';
52-
5343
part 'src/objects/parse_base.dart';
54-
5544
part 'src/objects/parse_cloneable.dart';
56-
5745
part 'src/objects/parse_config.dart';
58-
5946
part 'src/objects/parse_error.dart';
60-
6147
part 'src/objects/parse_exception.dart';
62-
6348
part 'src/objects/parse_file.dart';
64-
6549
part 'src/objects/parse_file_base.dart';
66-
6750
part 'src/objects/parse_file_web.dart';
68-
6951
part 'src/objects/parse_function.dart';
70-
7152
part 'src/objects/parse_geo_point.dart';
72-
7353
part 'src/objects/parse_installation.dart';
74-
7554
part 'src/objects/parse_number.dart';
76-
7755
part 'src/objects/parse_object.dart';
78-
7956
part 'src/objects/parse_operation/parse_add_operation.dart';
80-
8157
part 'src/objects/parse_operation/parse_add_relation_operation.dart';
82-
8358
part 'src/objects/parse_operation/parse_add_unique_operation.dart';
84-
8559
part 'src/objects/parse_operation/parse_increment_operation.dart';
86-
8760
part 'src/objects/parse_operation/parse_operation.dart';
88-
8961
part 'src/objects/parse_operation/parse_remove_operation.dart';
90-
9162
part 'src/objects/parse_operation/parse_remove_relation_operation.dart';
92-
9363
part 'src/objects/parse_relation.dart';
94-
9564
part 'src/objects/parse_response.dart';
96-
9765
part 'src/objects/parse_save_state_aware_child.dart';
98-
9966
part 'src/objects/parse_session.dart';
100-
10167
part 'src/objects/parse_user.dart';
102-
10368
part 'src/objects/parse_x_file.dart';
104-
10569
part 'src/objects/response/parse_error_response.dart';
106-
10770
part 'src/objects/response/parse_exception_response.dart';
108-
10971
part 'src/objects/response/parse_response_builder.dart';
110-
11172
part 'src/objects/response/parse_response_utils.dart';
112-
11373
part 'src/objects/response/parse_success_no_results.dart';
114-
11574
part 'src/storage/core_store.dart';
116-
11775
part 'src/storage/core_store_memory.dart';
118-
11976
part 'src/storage/core_store_sem_impl.dart';
120-
12177
part 'src/storage/xxtea_codec.dart';
122-
12378
part 'src/utils/parse_date_format.dart';
124-
12579
part 'src/utils/parse_decoder.dart';
126-
12780
part 'src/utils/parse_encoder.dart';
128-
12981
part 'src/utils/parse_live_list.dart';
130-
13182
part 'src/utils/parse_logger.dart';
132-
13383
part 'src/utils/parse_login_helpers.dart';
134-
13584
part 'src/utils/parse_utils.dart';
136-
13785
part 'src/utils/valuable.dart';
13886

13987
class Parse {

packages/dart/lib/src/objects/response/parse_exception_response.dart

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,12 @@ ParseResponse buildParseResponseWithException(Exception exception) {
2222
));
2323
}
2424

25+
if (exception is ClientException) {
26+
return ParseResponse(
27+
error: ParseError(message: exception.message, exception: exception),
28+
);
29+
}
30+
2531
return ParseResponse(
2632
error: ParseError(message: exception.toString(), exception: exception));
2733
}

0 commit comments

Comments
 (0)