Skip to content

Commit 29e4a9d

Browse files
Throw IllegalArgumentException when custom executor type is missing.
1 parent efa7094 commit 29e4a9d

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

  • jooby-executor/src/main/java/org/jooby/exec

jooby-executor/src/main/java/org/jooby/exec/Exec.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -364,7 +364,11 @@ private static Map<String, Object> executor(final String name, final boolean dae
364364
options.put("priority", priority);
365365
if (value instanceof Map) {
366366
Map<String, Object> config = (Map<String, Object>) value;
367-
String type = config.get("type").toString();
367+
Object rawType = config.get("type");
368+
if (rawType == null) {
369+
throw new IllegalArgumentException("Missing executor type");
370+
}
371+
String type = rawType.toString();
368372
options.put("type", type);
369373
options.put(type, config.containsKey("size") ?
370374
Integer.parseInt(config.get("size").toString()) : n);
@@ -375,7 +379,6 @@ private static Map<String, Object> executor(final String name, final boolean dae
375379
options.put("priority", config.containsKey("priority") ?
376380
Integer.parseInt(config.get("priority").toString()) : priority);
377381
} else {
378-
System.out.println("Bere");
379382
Iterable<String> spec = Splitter.on(",").trimResults().omitEmptyStrings()
380383
.split(value.toString());
381384
for (String option : spec) {

0 commit comments

Comments
 (0)