fix: The message field in UnknownRemoteException is typed as String? and the condition will always be false.
This commit is contained in:
@@ -1,11 +1,18 @@
|
||||
import 'package:tmail_ui_user/main/exceptions/remote/remote_exception.dart';
|
||||
|
||||
class UnknownRemoteException extends RemoteException {
|
||||
|
||||
final Object? error;
|
||||
|
||||
const UnknownRemoteException({
|
||||
super.code,
|
||||
super.message,
|
||||
this.error,
|
||||
});
|
||||
|
||||
@override
|
||||
String get exceptionName => 'UnknownRemoteException';
|
||||
|
||||
@override
|
||||
List<Object?> get props => [...super.props, error];
|
||||
}
|
||||
|
||||
@@ -97,7 +97,7 @@ class RemoteExceptionThrower extends ExceptionThrower {
|
||||
} else if (underlyingError is OAuthAuthorizationError) {
|
||||
throw underlyingError;
|
||||
} else if (underlyingError != null) {
|
||||
throw UnknownRemoteException(message: underlyingError.toString());
|
||||
throw UnknownRemoteException(error: underlyingError);
|
||||
} else {
|
||||
throw const UnknownRemoteException();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user