TF-1899 Sync and optimize handle error in base controller
(cherry picked from commit 1901d66c9100ca455c91ee8c95341de2a283eb67)
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
|
||||
import 'package:core/presentation/extensions/uri_extension.dart';
|
||||
import 'package:jmap_dart_client/http/converter/state_converter.dart';
|
||||
import 'package:jmap_dart_client/http/converter/user_name_converter.dart';
|
||||
import 'package:jmap_dart_client/jmap/core/session/session.dart';
|
||||
@@ -32,4 +33,12 @@ extension SessionExtensions on Session {
|
||||
}
|
||||
|
||||
SessionHiveObj toHiveObj() => SessionHiveObj(values: toJson());
|
||||
|
||||
String getQualifiedApiUrl({String? baseUrl}) {
|
||||
if (baseUrl != null) {
|
||||
return apiUrl.toQualifiedUrl(baseUrl: Uri.parse(baseUrl)).toString();
|
||||
} else {
|
||||
return apiUrl.toString();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -11,9 +11,8 @@ class GetSessionSuccess extends UIState {
|
||||
}
|
||||
|
||||
class GetSessionFailure extends FeatureFailure {
|
||||
final dynamic exception;
|
||||
|
||||
GetSessionFailure(this.exception);
|
||||
GetSessionFailure(dynamic exception) : super(exception: exception);
|
||||
|
||||
@override
|
||||
List<Object?> get props => [exception];
|
||||
|
||||
Reference in New Issue
Block a user