mirror of
https://git.mirrors.martin98.com/https://github.com/mendableai/firecrawl
synced 2025-08-14 18:36:00 +08:00
fix(cache): don't cache on failure error code
This commit is contained in:
parent
49ff37afb4
commit
359c30fbda
@ -3,6 +3,8 @@ import { Meta } from "..";
|
|||||||
import { CacheEntry, cacheKey, saveEntryToCache } from "../../../lib/cache";
|
import { CacheEntry, cacheKey, saveEntryToCache } from "../../../lib/cache";
|
||||||
|
|
||||||
export function saveToCache(meta: Meta, document: Document): Document {
|
export function saveToCache(meta: Meta, document: Document): Document {
|
||||||
|
if (document.metadata.statusCode! < 200 || document.metadata.statusCode! >= 300) return document;
|
||||||
|
|
||||||
if (document.rawHtml === undefined) {
|
if (document.rawHtml === undefined) {
|
||||||
throw new Error("rawHtml is undefined -- this transformer is being called out of order");
|
throw new Error("rawHtml is undefined -- this transformer is being called out of order");
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user