@@ -14,7 +14,7 @@ export 'package:normalize/normalize.dart' show PartialDataException;
1414@immutable
1515class CacheMissException extends LinkException {
1616 CacheMissException (this .message, this .request, {this .expectedData})
17- : super (null );
17+ : super (null , null );
1818
1919 final String message;
2020 final Request request;
@@ -37,18 +37,25 @@ class CacheMissException extends LinkException {
3737/// [CacheMisconfigurationException] .
3838class MismatchedDataStructureException extends LinkException {
3939 const MismatchedDataStructureException (
40- this .originalException, {
40+ this .originalException,
41+ this .originalStackTrace, {
4142 this .request,
4243 required this .data,
43- }) : super (originalException);
44+ }) : super (originalException, originalStackTrace );
4445
4546 final Map <String , dynamic >? data;
4647 final Request ? request;
48+
49+ @override
4750 final PartialDataException originalException;
4851
52+ @override
53+ final StackTrace originalStackTrace;
54+
4955 @override
5056 String toString () => 'MismatchedDataStructureException('
5157 '$originalException , '
58+ '$originalStackTrace , '
5259 'request: ${request }, '
5360 'data: ${data }, '
5461 ')' ;
@@ -62,11 +69,12 @@ class MismatchedDataStructureException extends LinkException {
6269class CacheMisconfigurationException extends LinkException
6370 implements MismatchedDataStructureException {
6471 const CacheMisconfigurationException (
65- this .originalException, {
72+ this .originalException,
73+ this .originalStackTrace, {
6674 this .request,
6775 this .fragmentRequest,
6876 required this .data,
69- }) : super (originalException);
77+ }) : super (originalException, originalStackTrace );
7078
7179 final Request ? request;
7280 final FragmentRequest ? fragmentRequest;
@@ -75,10 +83,14 @@ class CacheMisconfigurationException extends LinkException
7583 @override
7684 final PartialDataException originalException;
7785
86+ @override
87+ final StackTrace originalStackTrace;
88+
7889 @override
7990 String toString () => [
8091 'CacheMisconfigurationException(' ,
8192 '$originalException , ' ,
93+ '$originalStackTrace , ' ,
8294 if (request != null ) 'request: ${request }' ,
8395 if (fragmentRequest != null ) 'fragmentRequest : ${fragmentRequest }' ,
8496 'data: ${data }, ' ,
@@ -94,12 +106,15 @@ class CacheMisconfigurationException extends LinkException
94106class UnexpectedResponseStructureException extends ServerException
95107 implements MismatchedDataStructureException {
96108 const UnexpectedResponseStructureException (
97- this .originalException, {
109+ this .originalException,
110+ this .originalStackTrace, {
98111 required this .request,
99112 required Response parsedResponse,
100113 }) : super (
101- parsedResponse: parsedResponse,
102- originalException: originalException);
114+ parsedResponse: parsedResponse,
115+ originalException: originalException,
116+ originalStackTrace: originalStackTrace,
117+ );
103118
104119 @override
105120 final Request request;
@@ -110,9 +125,13 @@ class UnexpectedResponseStructureException extends ServerException
110125 @override
111126 final PartialDataException originalException;
112127
128+ @override
129+ final StackTrace originalStackTrace;
130+
113131 @override
114132 String toString () => 'UnexpectedResponseStructureException('
115133 '$originalException , '
134+ '$originalStackTrace , '
116135 'request: ${request }, '
117136 'parsedResponse: ${parsedResponse }, '
118137 ')' ;
@@ -124,13 +143,10 @@ class UnexpectedResponseStructureException extends ServerException
124143class UnknownException extends LinkException {
125144 String get message => 'Unhandled Client-Side Exception: $originalException ' ;
126145
127- /// stacktrace of the [originalException] .
128- final StackTrace originalStackTrace;
129-
130146 const UnknownException (
131- dynamic originalException,
132- this . originalStackTrace,
133- ) : super (originalException);
147+ Object originalException,
148+ StackTrace originalStackTrace,
149+ ) : super (originalException, originalStackTrace );
134150
135151 @override
136152 String toString () =>
@@ -147,8 +163,11 @@ class OperationException implements Exception {
147163 /// Errors encountered during execution such as network or cache errors
148164 LinkException ? linkException;
149165
166+ StackTrace ? originalStackTrace;
167+
150168 OperationException ({
151169 this .linkException,
170+ this .originalStackTrace,
152171 Iterable <GraphQLError > graphqlErrors = const [],
153172 }) : this .graphqlErrors = graphqlErrors.toList ();
154173
0 commit comments