File tree Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -4,6 +4,7 @@ import TempFileService from "../TempFileService";
44import * as cheerio from "cheerio" ;
55import { IEvent } from "../IEvent" ;
66import { JSDOM } from "jsdom" ;
7+ import { writeFile } from "fs/promises" ;
78
89export default class FetchPreview extends Command {
910
@@ -39,6 +40,14 @@ export default class FetchPreview extends Command {
3940
4041 if ( ! url ) {
4142 console . log ( `Failed to load url` ) ;
43+
44+ const htmlFile = await TempFileService . getTempFile ( ".html" ) ;
45+ await writeFile ( htmlFile . path , content , "utf8" ) ;
46+
47+ await this . upload ( { url : output , filePath : htmlFile . path } ) ;
48+
49+ throw new Error ( `Failed to load url , saved content at ${ output . split ( "?" ) [ 0 ] } ` ) ;
50+
4251 }
4352
4453 const file = await TempFileService . getTempFile ( ".jpg" ) ;
You can’t perform that action at this time.
0 commit comments