Skip to content

Commit

Permalink
Change error logs
Browse files Browse the repository at this point in the history
  • Loading branch information
PabloLec committed Oct 28, 2023
1 parent 2a2d13b commit 9092aa5
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions src/main/kotlin/api/ApiManager.kt
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ class ApiManager(private val mongoManager: MongoManager, var languages: Set<Lang
logger.error { " 403: Rate limit exceeded" }
break
}
logger.error { " $language | $e " }
logger.error(e) { " $language | Error in API query " }
break
}

Expand Down Expand Up @@ -110,7 +110,7 @@ class ApiManager(private val mongoManager: MongoManager, var languages: Set<Lang
val apiResponse = fetcher.fetchReposToUpdate(it)
addAll(apiResponse.repos)
} catch (e: Exception) {
logger.error { "Update error: $e " }
logger.error(e) { "Update error" }
}
}
}
Expand Down
10 changes: 5 additions & 5 deletions src/main/kotlin/api/Fetcher.kt
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class Fetcher {
try {
add(Repository.fromEdge(it!!))
} catch (e: Exception) {
logger.error { "Error while parsing edge $it: ${e.message}" }
logger.error(e) { "Error while parsing edge $it" }
}
}
}
Expand All @@ -52,7 +52,7 @@ class Fetcher {
try {
add(Repository.fromNode(it!!))
} catch (e: Exception) {
logger.error { "Error while parsing node $it: $e - ${e.message}" }
logger.error(e) { "Error while parsing node $it" }
}
}
}
Expand All @@ -71,7 +71,7 @@ class Fetcher {
response = client.query(GetUpdateDateQuery(repos.map { it.ghid })).execute()
if (response.errors != null) logger.error { "Response errors: ${response.errors}" }
} catch (e: Exception) {
logger.error { "Error while fetching update dates: ${e.message}" }
logger.error(e) { "Error while fetching update dates" }
return emptySet()
}

Expand All @@ -81,11 +81,11 @@ class Fetcher {
add(
Pair(
it!!.onRepository!!.id,
it.onRepository!!.defaultBranchRef!!.target!!.onCommit!!.pushedDate.toString()
it.onRepository!!.defaultBranchRef!!.target!!.onCommit!!.authoredDate.toString()
)
)
} catch (e: Exception) {
logger.error { "Error while parsing node $it: $e - ${e.message}" }
logger.error(e) { "Error while parsing node $it" }
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/main/kotlin/loc/GitCount.kt
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ class GitCount(val language: Language, val repo: Repository) {
lineCount += result.lineCount
parsedLength += result.parsedLength
} catch (e: VirtualMachineError) {
logger.error { "Error counting ${repo.url} file ${file.name} ${e.message}" }
logger.error(e) { "Error counting ${repo.url} file ${file.name}" }
lineCount += file.readText().lines().size
parsedLength += file.readText().length
} finally {
Expand Down

0 comments on commit 9092aa5

Please sign in to comment.