Skip to content

Commit d8a368c

Browse files
committed
Removed unused import
1 parent 7238fe4 commit d8a368c

File tree

4 files changed

+24
-21
lines changed

4 files changed

+24
-21
lines changed

Diff for: packages/firebase_data_connect/firebase_data_connect/lib/src/common/common_library.dart

-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
import 'dart:convert';
1616

1717
import 'package:firebase_app_check/firebase_app_check.dart';
18-
import 'package:firebase_data_connect/src/generated/graphql_error.pb.dart';
1918

2019
part 'dataconnect_error.dart';
2120
part 'dataconnect_options.dart';

Diff for: packages/firebase_data_connect/firebase_data_connect/lib/src/common/dataconnect_error.dart

+20-16
Original file line numberDiff line numberDiff line change
@@ -28,30 +28,34 @@ class DataConnectError<T> extends FirebaseException {
2828
final DataConnectErrorCode dataConnectErrorCode;
2929
}
3030

31-
class SubError {
32-
SubError(this.path, this.message);
33-
String message;
34-
List<PathSegment> path;
35-
}
36-
37-
class PathSegment {
38-
PathSegment({this.field, this.listIndex});
39-
String? field;
40-
int? listIndex;
31+
/// Error thrown when an operation is partially successful.
32+
class DataConnectOperationError extends DataConnectError {
33+
DataConnectOperationError(
34+
DataConnectErrorCode code, String message, this.response)
35+
: super(code, message);
36+
final DataConnectOperationResponse response;
4137
}
4238

39+
/// Nested class containing errors and decoded data.
4340
class DataConnectOperationResponse<T> {
4441
DataConnectOperationResponse(this.errors, this.data, this.decodedData);
4542
final Map<String, dynamic>? data;
46-
final List<SubError> errors;
43+
final List<ResponseError> errors;
4744
final T? decodedData;
4845
}
4946

50-
class DataConnectOperationError extends DataConnectError {
51-
DataConnectOperationError(
52-
DataConnectErrorCode code, String message, this.response)
53-
: super(code, message);
54-
final DataConnectOperationResponse response;
47+
/// Error information per error.
48+
class ResponseError {
49+
ResponseError(this.path, this.message);
50+
String message;
51+
List<PathSegment> path;
52+
}
53+
54+
/// Path where error occurred.
55+
class PathSegment {
56+
PathSegment({this.field, this.listIndex});
57+
String? field;
58+
int? listIndex;
5559
}
5660

5761
typedef Serializer<Variables> = String Function(Variables vars);

Diff for: packages/firebase_data_connect/firebase_data_connect/lib/src/network/grpc_transport.dart

+2-2
Original file line numberDiff line numberDiff line change
@@ -175,8 +175,8 @@ Data handleResponse<Data>(CommonResponse<Data> commonResponse) {
175175
Map<String, dynamic>? data =
176176
jsonDecode(jsonEncoded) as Map<String, dynamic>?;
177177
Data? decodedData;
178-
List<SubError> errors = commonResponse.errors
179-
.map((e) => SubError(
178+
List<ResponseError> errors = commonResponse.errors
179+
.map((e) => ResponseError(
180180
e.path.values
181181
.map((val) => val.hasStringValue()
182182
? PathSegment(field: val.stringValue)

Diff for: packages/firebase_data_connect/firebase_data_connect/lib/src/network/rest_transport.dart

+2-2
Original file line numberDiff line numberDiff line change
@@ -143,11 +143,11 @@ class RestTransport implements DataConnectTransport {
143143
}
144144
List<dynamic> errors =
145145
jsonDecode(jsonEncode(bodyJson['errors'])) as List<dynamic>;
146-
List<SubError> suberrors = errors
146+
List<ResponseError> suberrors = errors
147147
.map((e) {
148148
return jsonDecode(jsonEncode(e)) as Map<String, dynamic>;
149149
})
150-
.map((e) => SubError(
150+
.map((e) => ResponseError(
151151
(e['path'] as List)
152152
.map((val) => val.runtimeType == String
153153
? PathSegment(field: val)

0 commit comments

Comments
 (0)