Fix next edge runtime not liking error in logs (#247)

* Fix next edge runtime not liking error in logs

* Fix other errors
This commit is contained in:
Samy Pessé
2024-03-13 10:04:43 +00:00
committed by GitHub
parent 0da4e9a926
commit bdbd14c560
3 changed files with 11 additions and 3 deletions
+5 -1
View File
@@ -433,7 +433,11 @@ export async function getSpaceCustomization(spaceId: string): Promise<Customizat
const parsed = rison.decode_object<Partial<CustomizationSettings>>(extend);
return { ...raw, ...parsed };
} catch (error) {
console.error('Failed to parse x-gitbook-customization header (ignored)', error);
console.error(
`Failed to parse x-gitbook-customization header (ignored): ${
(error as Error).stack ?? (error as Error).message ?? error
}`,
);
}
}
+1 -1
View File
@@ -208,7 +208,7 @@ function logIgnoredError(message: string, error: Error) {
return;
}
console.error(message, error);
console.error(`${message}: ${error.stack ?? error.message ?? error}`);
}
const UndefinedSymbol = Symbol('Undefined');
+5 -1
View File
@@ -108,7 +108,11 @@ export async function getImageSize(
height: json.original.height,
};
} catch (error) {
console.error(`failed to fetch image size for ${input}`, error);
console.error(
`failed to fetch image size for ${input}: ${
(error as Error).stack ?? (error as Error).message ?? error
}`,
);
return null;
}
}