MCPcopy
hub / github.com/jvilk/BrowserFS / standardizeError

Method standardizeError

src/backend/MountableFileSystem.ts:187–194  ·  view source on GitHub ↗

* Fixes up error messages so they mention the mounted file location relative * to the MFS root, not to the particular FS's root. * Mutates the input error, and returns it.

(err: ApiError, path: string, realPath: string)

Source from the content-addressed store, hash-verified

185 * Mutates the input error, and returns it.
186 */
187 public standardizeError(err: ApiError, path: string, realPath: string): ApiError {
188 const index = err.message.indexOf(path);
189 if (index !== -1) {
190 err.message = err.message.substr(0, index) + realPath + err.message.substr(index + path.length);
191 err.path = realPath;
192 }
193 return err;
194 }
195
196 // The following methods involve multiple file systems, and thus have custom
197 // logic.

Callers 7

renameMethod · 0.95
renameSyncMethod · 0.95
readdirSyncMethod · 0.95
readdirMethod · 0.95
rmdirSyncMethod · 0.95
rmdirMethod · 0.95
defineFcnFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected