[HOT-FIX] Webfinger is recalled many times

(cherry picked from commit 1873e0f199c29965543a7504f30308e0024c725c)
This commit is contained in:
dab246
2023-06-29 16:45:29 +07:00
committed by Dat Vu
parent 7c1f8cc2c7
commit bc8a03cbce
5 changed files with 75 additions and 69 deletions
@@ -23,31 +23,33 @@ class RemoteExceptionThrower extends ExceptionThrower {
} else {
if (error is DioError) {
logError('RemoteExceptionThrower::throwException():type: ${error.type} | response: ${error.response} | error: ${error.error}');
switch (error.type) {
case DioErrorType.connectionTimeout:
throw ConnectionTimeout(message: error.message);
case DioErrorType.connectionError:
throw ConnectionError(message: error.message);
default:
if (error.response?.statusCode == HttpStatus.internalServerError) {
throw const InternalServerError();
} else if (error.response?.statusCode == HttpStatus.badGateway) {
throw BadGateway();
} else if (error.response?.statusCode == HttpStatus.unauthorized) {
throw const BadCredentialsException();
} else if (error.error is SocketException) {
throw const SocketError();
} else {
if (error.response != null) {
throw UnknownError(
code: error.response!.statusCode,
message: error.response!.statusMessage);
if (error.response != null) {
if (error.response!.statusCode == HttpStatus.internalServerError) {
throw const InternalServerError();
} else if (error.response!.statusCode == HttpStatus.badGateway) {
throw BadGateway();
} else if (error.response!.statusCode == HttpStatus.unauthorized) {
throw const BadCredentialsException();
} else {
throw UnknownError(
code: error.response!.statusCode,
message: error.response!.statusMessage);
}
} else {
switch (error.type) {
case DioErrorType.connectionTimeout:
throw ConnectionTimeout(message: error.message);
case DioErrorType.connectionError:
throw ConnectionError(message: error.message);
default:
if (error.error is SocketException) {
throw const SocketError();
} else if (error.error != null) {
throw UnknownError(message: error.error!.toString());
} else {
throw const UnknownError();
}
}
}
}
} else if (error is ErrorMethodResponseException) {
final errorResponse = error.errorResponse as ErrorMethodResponse;