Changed all error returns to OperationErrors

This commit is contained in:
Matt C 2018-05-15 18:01:04 +01:00
parent b3ee251ee3
commit 2e4f5b7070
25 changed files with 88 additions and 35 deletions

View file

@ -5,6 +5,7 @@
*/
import Operation from "../Operation";
import OperationError from "../errors/OperationError";
/**
* Parse UNIX file permissions operation
@ -169,7 +170,7 @@ class ParseUNIXFilePermissions extends Operation {
}
}
} else {
return "Invalid input format.\nPlease enter the permissions in either octal (e.g. 755) or textual (e.g. drwxr-xr-x) format.";
throw new OperationError("Invalid input format.\nPlease enter the permissions in either octal (e.g. 755) or textual (e.g. drwxr-xr-x) format.");
}
output += "Textual representation: " + permsToStr(perms);