File tree Expand file tree Collapse file tree 2 files changed +7
-0
lines changed
src/renderer/actions/local-sync Expand file tree Collapse file tree 2 files changed +7
-0
lines changed Original file line number Diff line number Diff line change @@ -201,6 +201,10 @@ export function isAccessError(error: any) {
201201 return error . code === "EACCES" ;
202202}
203203
204+ export function isNotPermitted ( error : any ) {
205+ return error . code === "EPERM" ;
206+ }
207+
204208export function isNotFoundError ( error : any ) {
205209 return error . code === "ENOENT" ;
206210}
@@ -212,6 +216,8 @@ export function createFileSystemError(
212216) : FileSystemError {
213217 const errorCode = isAccessError ( error )
214218 ? ErrorCode . PermissionDenied
219+ : isNotPermitted ( error )
220+ ? ErrorCode . NotPermitted
215221 : isNotFoundError ( error )
216222 ? ErrorCode . NotFound
217223 : ErrorCode . UNKNOWN ;
Original file line number Diff line number Diff line change @@ -22,6 +22,7 @@ export enum FileTypeEnum {
2222export enum ErrorCode {
2323 WrongInput = "wrong_input" ,
2424 PermissionDenied = "permission_denied" ,
25+ NotPermitted = "not_permitted" ,
2526 MigrationFailed = "migration_failed" ,
2627 EntityAlreadyExists = "entity_already_exists" ,
2728 NotFound = "not_found" ,
You can’t perform that action at this time.
0 commit comments