File tree Expand file tree Collapse file tree 1 file changed +8
-8
lines changed Expand file tree Collapse file tree 1 file changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -155,20 +155,20 @@ const createError = (code, message) => {
155155/**
156156 * Resolves a mountpoint
157157 */
158- const mountpointResolver = core => ( path ) => {
158+ const mountpointResolver = core => async ( path ) => {
159159 const { adapters, mountpoints} = core . make ( 'osjs/vfs' ) ;
160160 const prefix = getPrefix ( path ) ;
161161 const mount = mountpoints . find ( m => m . name === prefix ) ;
162162
163- if ( mount ) {
164- const adapter = mount . adapter
165- ? adapters [ mount . adapter ]
166- : adapters . system ;
167-
168- return Promise . resolve ( { mount, adapter} ) ;
163+ if ( ! mount ) {
164+ throw createError ( 403 , `Mountpoint not found for '${ prefix } '` ) ;
169165 }
170166
171- return Promise . reject ( createError ( 403 , `Mountpoint not found for '${ prefix } '` ) ) ;
167+ const adapter = await ( mount . adapter
168+ ? adapters [ mount . adapter ]
169+ : adapters . system ) ;
170+
171+ return { mount, adapter} ;
172172} ;
173173
174174/*
You can’t perform that action at this time.
0 commit comments