Skip to content

Commit 3cd6b6c

Browse files
committed
return up to 40 sorted scenario application msgs
1 parent 1f13b2e commit 3cd6b6c

File tree

2 files changed

+4
-10
lines changed

2 files changed

+4
-10
lines changed

src/main/java/com/conveyal/r5/analyst/error/TaskError.java

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -30,21 +30,15 @@ public TaskError(Throwable throwable) {
3030
}
3131

3232
/**
33-
* This constructor is used for errors that occur while applying a scenario to a network.
34-
* messages will generally be either the errors or warnings associated with the modification, which is why there is
35-
* a separate argument; otherwise we wouldn't know whether errors or warnings were desired.
33+
* This constructor is used for errors, warnings, or informational messages that occur
34+
* while applying a scenario to a network.
3635
*/
3736
public TaskError(Modification modification, Collection<String> messages) {
3837
this.modificationId = modification.comment;
3938
this.title = "while applying the modification entitled '" + modification.comment + "'.";
4039
checkArgument(messages.size() <= Modification.MAX_MESSAGES + 1);
4140
this.messages.addAll(messages);
42-
}
43-
44-
public TaskError(String modificationId, String title, String detail) {
45-
this.modificationId = modificationId;
46-
this.title = title;
47-
this.messages.add(detail);
41+
this.messages.sort(String::compareTo);
4842
}
4943

5044
}

src/main/java/com/conveyal/r5/analyst/scenario/Modification.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ public abstract class Modification implements Serializable {
3939
* The maximum number of error messages in each category (info/warning/error) to store in each modification.
4040
* This prevents bandwidth/latency/memory problems from sending enormous lists of errors back to the client.
4141
*/
42-
public static final int MAX_MESSAGES = 5;
42+
public static final int MAX_MESSAGES = 40;
4343

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

0 commit comments

Comments
 (0)