diff --git a/src/main/kotlin/dev/hossain/githubstats/service/IssueSearchPagerService.kt b/src/main/kotlin/dev/hossain/githubstats/service/IssueSearchPagerService.kt index 326d557..dbe575b 100644 --- a/src/main/kotlin/dev/hossain/githubstats/service/IssueSearchPagerService.kt +++ b/src/main/kotlin/dev/hossain/githubstats/service/IssueSearchPagerService.kt @@ -5,6 +5,7 @@ import dev.hossain.githubstats.logging.Log import dev.hossain.githubstats.model.Issue import dev.hossain.githubstats.model.IssueSearchResult import dev.hossain.githubstats.service.GithubApiService.Companion.DEFAULT_PAGE_SIZE +import dev.hossain.githubstats.util.ErrorInfo import dev.hossain.githubstats.util.ErrorProcessor import kotlinx.coroutines.delay import kotlin.math.ceil @@ -33,8 +34,14 @@ class IssueSearchPagerService constructor( size = pageSize, ) } catch (exception: Exception) { - val errorInfo = errorProcessor.getDetailedError(exception) - throw errorInfo.exception + val errorInfo: ErrorInfo = errorProcessor.getDetailedError(exception) + + if(errorInfo.isUserNotFound()) { + Log.w("❌ User not found. Skipping the PR list search for the user.\n") + return emptyList() + } else { + throw errorInfo.exception + } } val totalItemCount: Int = issueSearchResult.total_count diff --git a/src/main/kotlin/dev/hossain/githubstats/util/ErrorInfo.kt b/src/main/kotlin/dev/hossain/githubstats/util/ErrorInfo.kt index 021828f..6a03588 100644 --- a/src/main/kotlin/dev/hossain/githubstats/util/ErrorInfo.kt +++ b/src/main/kotlin/dev/hossain/githubstats/util/ErrorInfo.kt @@ -11,7 +11,11 @@ data class ErrorInfo( val exception: Exception, val debugGuideMessage: String = "", val githubError: GithubError? = null, -) +) { + fun isUserNotFound(): Boolean { + return ErrorProcessor.isUserMissingError(githubError) + } +} /** * Error threshold information.