Skip to content

Commit

Permalink
return up to 40 sorted scenario application msgs
Browse files Browse the repository at this point in the history
  • Loading branch information
abyrd committed Jan 11, 2024
1 parent 1f13b2e commit 3cd6b6c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 10 deletions.
12 changes: 3 additions & 9 deletions src/main/java/com/conveyal/r5/analyst/error/TaskError.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,21 +30,15 @@ public TaskError(Throwable throwable) {
}

/**
* This constructor is used for errors that occur while applying a scenario to a network.
* messages will generally be either the errors or warnings associated with the modification, which is why there is
* a separate argument; otherwise we wouldn't know whether errors or warnings were desired.
* This constructor is used for errors, warnings, or informational messages that occur
* while applying a scenario to a network.
*/
public TaskError(Modification modification, Collection<String> messages) {
this.modificationId = modification.comment;
this.title = "while applying the modification entitled '" + modification.comment + "'.";
checkArgument(messages.size() <= Modification.MAX_MESSAGES + 1);
this.messages.addAll(messages);
}

public TaskError(String modificationId, String title, String detail) {
this.modificationId = modificationId;
this.title = title;
this.messages.add(detail);
this.messages.sort(String::compareTo);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public abstract class Modification implements Serializable {
* The maximum number of error messages in each category (info/warning/error) to store in each modification.
* This prevents bandwidth/latency/memory problems from sending enormous lists of errors back to the client.
*/
public static final int MAX_MESSAGES = 5;
public static final int MAX_MESSAGES = 40;

/** Free-text comment describing this modification instance and what it's intended to do or represent. */
public String comment;
Expand Down

0 comments on commit 3cd6b6c

Please sign in to comment.