mirror of
https://github.com/tdurieux/anonymous_github.git
synced 2026-02-13 02:42:45 +00:00
chore: improves logging
This commit is contained in:
@@ -39,7 +39,7 @@ export async function getRepo(
|
||||
|
||||
function printError(error: any) {
|
||||
if (error instanceof AnonymousError) {
|
||||
let detail = error.value?.toString();
|
||||
let detail = error.value ? JSON.stringify(error.value) : null;
|
||||
if (error.value instanceof Repository) {
|
||||
detail = error.value.repoId;
|
||||
} else if (error.value instanceof AnonymizedFile) {
|
||||
@@ -54,7 +54,7 @@ function printError(error: any) {
|
||||
console.error(
|
||||
"[ERROR]",
|
||||
error.message,
|
||||
`'${detail}'`,
|
||||
detail ? `'${detail}'` : null,
|
||||
error.stack.split("\n")[1].trim()
|
||||
);
|
||||
} else if (error instanceof Error) {
|
||||
|
||||
@@ -59,7 +59,7 @@ export default class GitHubStream extends GitHubBase implements SourceBase {
|
||||
}
|
||||
console.error(error);
|
||||
}
|
||||
throw new AnonymousError("file_not_accessible");
|
||||
throw new AnonymousError("file_not_accessible", file);
|
||||
}
|
||||
|
||||
async getFiles() {
|
||||
|
||||
Reference in New Issue
Block a user