cleanup debug logging

This commit is contained in:
ddivad195
2024-02-06 18:27:57 +00:00
parent 1167b03ce8
commit b42b69f193
2 changed files with 6 additions and 20 deletions
+3 -10
View File
@@ -204,20 +204,13 @@ const fetchWithDebug = async (
url: string,
config: RequestInit = {}
): Promise<Response> => {
const debugLogs = core.isDebug()
if (debugLogs) {
core.debug(`Request from ${url} with config: ${JSON.stringify(config)}`)
}
core.debug(`Request from ${url} with config: ${JSON.stringify(config)}`)
try {
const response = await fetch(url, config)
if (debugLogs) {
core.debug(`Response with ${JSON.stringify(response)}`)
}
core.debug(`Response with ${JSON.stringify(response)}`)
return response
} catch (error) {
if (debugLogs) {
core.debug(`Error with ${error}`)
}
core.debug(`Error with ${error}`)
throw error
}
}