File tree 2 files changed +4
-0
lines changed
packages/docsify-server-renderer
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'
6
6
import { readFileSync } from 'fs'
7
7
import { resolve , basename } from 'path'
8
8
import resolvePathname from 'resolve-pathname'
9
+ import debug from 'debug'
9
10
10
11
function cwd ( ...args ) {
11
12
return resolve ( process . cwd ( ) , ...args )
@@ -112,10 +113,12 @@ export default class Renderer {
112
113
}
113
114
114
115
async _loadFile ( filePath ) {
116
+ debug ( 'docsify' ) ( `load > ${ filePath } ` )
115
117
let content
116
118
try {
117
119
if ( isAbsolutePath ( filePath ) ) {
118
120
const res = await fetch ( filePath )
121
+ if ( ! res . ok ) throw Error ( )
119
122
content = await res . text ( )
120
123
this . lock = 0
121
124
} else {
Original file line number Diff line number Diff line change 15
15
"test" : " echo 'hello'"
16
16
},
17
17
"dependencies" : {
18
+ "debug" : " ^2.6.8" ,
18
19
"node-fetch" : " ^1.7.0" ,
19
20
"resolve-pathname" : " ^2.1.0"
20
21
}
You can’t perform that action at this time.
0 commit comments