Skip to content

Commit

Permalink
fix(ui/cli): don't print a groovy runtime exception due to wrong API
Browse files Browse the repository at this point in the history
usage

Previously the argument was omitted causing an uncaught
org.codehaus.groovy.runtime.metaclass.MethodSelectionException to be
thrown because Groovy could not determine the correct constructor.
  • Loading branch information
thetric committed Jun 17, 2017
1 parent 02e413b commit 59f5630
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ class CliService {
final CliBuilder cliBuilder = createCliBuilder()
final OptionAccessor opts = cliBuilder.parse(args)
if (!opts) {
throw new InvalidUsageException()
throw new InvalidUsageException(resourceBundle.getString('args.invalid'))
}
return opts
}
Expand Down
2 changes: 2 additions & 0 deletions ui/cli/src/main/resources/ilias-cli.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
args.course.selection=show dialog to select courses to sync
args.directory = Directory
args.directory.description = Directory for the sync (required)
args.invalid=Invalid arguments!
args.sync.max-size=size limit in MiB per file download (exclusive)
args.sync.max-size.negative=max download size per item must not be negative:

Expand All @@ -14,3 +15,4 @@ sync.finished = Sync finished
sync.courses.available=Available courses:
sync.courses.prompt=Enter the numbers of the courses to sync (separate by a space) or leave blank to select all
sync.courses.prompt.errors.out-of-range=Invalid course selection! The selection must contain indices between 1 and {0}
1 change: 1 addition & 0 deletions ui/cli/src/main/resources/ilias-cli_de.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
args.course.selection=zeigt einen Dialog zur Auswahl der zu synchronisierenden Kurse an
args.directory = Ordner
args.directory.description = Zielordner fr die Synchronisierung
args.invalid=Ungültige Kommandozeilenargumente!
args.sync.max-size=maximale Größe der herunterzuladenen Datei in MiB (exklusive)
args.sync.max-size.negative=Downloadlimit pro Datei darf nicht negativ sein:

Expand Down

0 comments on commit 59f5630

Please sign in to comment.