|
23 | 23 | import com.cognifide.apm.core.Property;
|
24 | 24 | import com.cognifide.apm.core.endpoints.response.ResponseEntity;
|
25 | 25 | import com.cognifide.apm.core.endpoints.utils.RequestProcessor;
|
26 |
| -import com.cognifide.apm.core.scripts.ScriptStorageException; |
27 | 26 | import com.cognifide.apm.core.scripts.ScriptStorageImpl;
|
28 | 27 | import com.day.cq.commons.jcr.JcrConstants;
|
29 | 28 | import com.day.cq.commons.jcr.JcrUtil;
|
30 | 29 | import java.io.IOException;
|
31 | 30 | import java.util.ArrayList;
|
32 | 31 | import java.util.List;
|
33 | 32 | import java.util.regex.Pattern;
|
| 33 | +import java.util.stream.Collectors; |
34 | 34 | import javax.jcr.Session;
|
35 | 35 | import javax.servlet.Servlet;
|
36 | 36 | import org.apache.commons.lang3.StringUtils;
|
@@ -118,7 +118,9 @@ private void validate(String path, String name) {
|
118 | 118 | containsExtension(name) ? SCRIPT_PATTERN : FOLDER_PATTERN);
|
119 | 119 | ScriptStorageImpl.ensurePropertyMatchesPattern(validationErrors, "destination", path, DESTINATION_PATTERN);
|
120 | 120 | if (!validationErrors.isEmpty()) {
|
121 |
| - throw new ScriptStorageException("Script errors", validationErrors); |
| 121 | + String message = validationErrors.stream() |
| 122 | + .collect(Collectors.joining("\n", "Validation errors:\n", "")); |
| 123 | + throw new RuntimeException(message); |
122 | 124 | }
|
123 | 125 | }
|
124 | 126 | }
|
0 commit comments