* Converts a Dropbox-JS error into a BFS error.
(err: Dropbox.ApiError, path: string | null = null)
| 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 | } |
no test coverage detected