fix(llc): cancelling attachments now removes it from the message.

Signed-off-by: xsahil03x <[email protected]>
This commit is contained in:
Sahil Kumar
2023-02-08 19:08:21 +05:30
committed by xsahil03x
parent 4563abaaef
commit b656c8b7d8
2 changed files with 23 additions and 2 deletions
@@ -74,6 +74,7 @@ class StreamChatNetworkError extends StreamChatError {
ChatErrorCode errorCode, {
int? statusCode,
this.data,
this.isRequestCancelledError = false,
}) : code = errorCode.code,
statusCode = statusCode ?? data?.statusCode,
super(errorCode.message);
@@ -84,6 +85,7 @@ class StreamChatNetworkError extends StreamChatError {
required String message,
this.statusCode,
this.data,
this.isRequestCancelledError = false,
}) : super(message);
///
@@ -100,6 +102,7 @@ class StreamChatNetworkError extends StreamChatError {
errorResponse?.message ?? response?.statusMessage ?? error.message,
statusCode: errorResponse?.statusCode ?? response?.statusCode,
data: errorResponse,
isRequestCancelledError: error.type == DioErrorType.cancel,
)..stackTrace = error.stackTrace;
}
@@ -112,6 +115,9 @@ class StreamChatNetworkError extends StreamChatError {
/// Response body. please refer to [ErrorResponse].
final ErrorResponse? data;
/// True, in case the error is due to a cancelled network request.
final bool isRequestCancelledError;
StackTrace? _stackTrace;
///