|
24 | 24 | import org.commonwl.view.git.GitDetails; |
25 | 25 | import org.commonwl.view.graphviz.GraphVizService; |
26 | 26 | import org.eclipse.jgit.api.errors.GitAPIException; |
| 27 | +import org.eclipse.jgit.api.errors.TransportException; |
27 | 28 | import org.slf4j.Logger; |
28 | 29 | import org.slf4j.LoggerFactory; |
29 | 30 | import org.springframework.beans.factory.annotation.Autowired; |
@@ -120,6 +121,9 @@ public ModelAndView createWorkflow(@Valid WorkflowForm workflowForm, BindingResu |
120 | 121 | if (workflow == null) { |
121 | 122 | try { |
122 | 123 | workflow = workflowService.createQueuedWorkflow(gitInfo).getTempRepresentation(); |
| 124 | + } catch (TransportException ex) { |
| 125 | + bindingResult.rejectValue("url", "git.sshError"); |
| 126 | + return new ModelAndView("index"); |
123 | 127 | } catch (GitAPIException ex) { |
124 | 128 | bindingResult.rejectValue("url", "git.retrievalError"); |
125 | 129 | logger.error("Git API Error", ex); |
@@ -450,9 +454,10 @@ private ModelAndView getWorkflow(GitDetails gitDetails, RedirectAttributes redir |
450 | 454 | if (!errors.hasErrors()) { |
451 | 455 | try { |
452 | 456 | queued = workflowService.createQueuedWorkflow(gitDetails); |
| 457 | + } catch (TransportException ex) { |
| 458 | + errors.rejectValue("url", "git.sshError", "SSH URLs are not supported, please provide a HTTPS URL for the repository or submodules"); |
453 | 459 | } catch (GitAPIException ex) { |
454 | 460 | errors.rejectValue("url", "git.retrievalError", "The workflow could not be retrieved from the Git repository using the details given"); |
455 | | - logger.error("Git API Error", ex); |
456 | 461 | } catch (WorkflowNotFoundException ex) { |
457 | 462 | errors.rejectValue("url", "git.pathTraversal", "The path given did not resolve to a location within the repository"); |
458 | 463 | } catch (IOException ex) { |
|
0 commit comments