TF-1829 Fix app crash upon 401

(cherry picked from commit 8906322f932c4e1edadaf3f1831fc533fddd9a8b)
This commit is contained in:
dab246
2023-06-28 16:10:13 +07:00
committed by Dat Vu
parent e9f3f7f012
commit 7c1f8cc2c7
6 changed files with 47 additions and 13 deletions
@@ -25,7 +25,9 @@ class RemoteExceptionThrower extends ExceptionThrower {
logError('RemoteExceptionThrower::throwException():type: ${error.type} | response: ${error.response} | error: ${error.error}');
switch (error.type) {
case DioErrorType.connectionTimeout:
throw const ConnectError();
throw ConnectionTimeout(message: error.message);
case DioErrorType.connectionError:
throw ConnectionError(message: error.message);
default:
if (error.response?.statusCode == HttpStatus.internalServerError) {
throw const InternalServerError();