TF-3707 Show error description from JMAP response if possible
Signed-off-by: dab246 <tdvu@linagora.com>
This commit is contained in:
@@ -0,0 +1,12 @@
|
||||
|
||||
import 'package:jmap_dart_client/jmap/core/error/method/error_method_response.dart';
|
||||
import 'package:jmap_dart_client/jmap/core/error/method/exception/error_method_response_exception.dart';
|
||||
|
||||
extension ErrorMethodResponseExceptionExtension on ErrorMethodResponseException {
|
||||
String get errorMessage {
|
||||
if (errorResponse is ErrorMethodResponse) {
|
||||
return (errorResponse as ErrorMethodResponse).description?.trim() ?? '';
|
||||
}
|
||||
return '';
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user