getChaptersAndCompletion method
override
Implementation
@override
Future<ChaptersAndCompletionDto> getChaptersAndCompletion() async {
try {
final result = await _client.getChaptersAndCompletionRatesGet();
final resultData = result.data;
if (resultData == null) {
throw RepositoryException(
RepositoryErrorType.notFound,
RepositoryErrorType.notFound.message,
);
}
final convertedChapters =
_modelConvertManager.convertToChaptersAndCompletionDto(
chaptersAndCompletionRates: resultData,
);
return convertedChapters;
} on RepositoryException catch (_) {
rethrow;
} on DioException catch (error, stackTrace) {
throw await _dioErrorHandler.handleDioError(
error,
stackTrace,
null,
);
} catch (error, stackTrace) {
throw _repositoryErrorHandler.handleUnknownError(error, stackTrace);
}
}