File tree Expand file tree Collapse file tree 2 files changed +4
-0
lines changed
packages/docsify-server-renderer Expand file tree Collapse file tree 2 files changed +4
-0
lines changed Original file line number Diff line number Diff line change @@ -6,6 +6,7 @@ import { isAbsolutePath } from '../../src/core/router/util'
66import { readFileSync } from 'fs'
77import { resolve , basename } from 'path'
88import resolvePathname from 'resolve-pathname'
9+ import debug from 'debug'
910
1011function cwd ( ...args ) {
1112 return resolve ( process . cwd ( ) , ...args )
@@ -112,10 +113,12 @@ export default class Renderer {
112113 }
113114
114115 async _loadFile ( filePath ) {
116+ debug ( 'docsify' ) ( `load > ${ filePath } ` )
115117 let content
116118 try {
117119 if ( isAbsolutePath ( filePath ) ) {
118120 const res = await fetch ( filePath )
121+ if ( ! res . ok ) throw Error ( )
119122 content = await res . text ( )
120123 this . lock = 0
121124 } else {
Original file line number Diff line number Diff line change 1515 "test" : " echo 'hello'"
1616 },
1717 "dependencies" : {
18+ "debug" : " ^2.6.8" ,
1819 "node-fetch" : " ^1.7.0" ,
1920 "resolve-pathname" : " ^2.1.0"
2021 }
You can’t perform that action at this time.
0 commit comments