MCPcopy Index your code
hub / github.com/jvilk/BrowserFS / convert

Method convert

src/backend/Dropbox.ts:654–665  ·  view source on GitHub ↗

* Converts a Dropbox-JS error into a BFS error.

(err: Dropbox.ApiError, path: string | null = null)

Source from the content-addressed store, hash-verified

652 * Converts a Dropbox-JS error into a BFS error.
653 */
654 public convert(err: Dropbox.ApiError, path: string | null = null): ApiError {
655 let errorCode = errorCodeLookup[err.status];
656 if (errorCode === undefined) {
657 errorCode = ErrorCode.EIO;
658 }
659
660 if (!path) {
661 return new ApiError(errorCode);
662 } else {
663 return ApiError.FileError(errorCode, path);
664 }
665 }
666}

Callers 9

emptyMethod · 0.95
deleteFileMethod · 0.95
renameMethod · 0.95
statMethod · 0.95
openMethod · 0.95
_writeFileStrictMethod · 0.95
_removeMethod · 0.95
mkdirMethod · 0.95
readdirMethod · 0.95

Calls 1

FileErrorMethod · 0.80

Tested by

no test coverage detected