Added Error handling

This commit is contained in:
Mohammad Salameh
2024-03-10 08:56:06 +03:00
parent d70c370c2e
commit 5a7787b42d
7 changed files with 37 additions and 128 deletions

View File

@ -17,12 +17,12 @@ class ServerFailure extends Failure {
factory ServerFailure.fromDioError(DioException dioError) {
switch (dioError.type) {
case DioExceptionType.connectionTimeout:
return ServerFailure("Connection timeout with ApiServer.");
return ServerFailure("Connection timeout with the Server.");
case DioExceptionType.sendTimeout:
return ServerFailure("Send timeout with ApiServer.");
return ServerFailure("Send timeout with the Server.");
case DioExceptionType.receiveTimeout:
return ServerFailure("Receive timeout with ApiServer.");
return ServerFailure("Receive timeout with the Server.");
case DioExceptionType.badCertificate:
return ServerFailure("Bad certificate!");