• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

common-workflow-language / cwlviewer / #1761

28 Feb 2025 02:09AM CUT coverage: 70.306%. Remained the same
#1761

Pull #682

github

web-flow
Bump actions/cache from 4.2.0 to 4.2.2

Bumps [actions/cache](https://github.com/actions/cache) from 4.2.0 to 4.2.2.
- [Release notes](https://github.com/actions/cache/releases)
- [Changelog](https://github.com/actions/cache/blob/main/RELEASES.md)
- [Commits](https://github.com/actions/cache/compare/v4.2.0...v4.2.2)

---
updated-dependencies:
- dependency-name: actions/cache
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Pull Request #682: Bump actions/cache from 4.2.0 to 4.2.2

1700 of 2418 relevant lines covered (70.31%)

0.7 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/src/main/java/org/commonwl/view/GlobalControllerErrorHandling.java
1
/*
2
 * Licensed to the Apache Software Foundation (ASF) under one
3
 * or more contributor license agreements.  See the NOTICE file
4
 * distributed with this work for additional information
5
 * regarding copyright ownership.  The ASF licenses this file
6
 * to you under the Apache License, Version 2.0 (the
7
 * "License"); you may not use this file except in compliance
8
 * with the License.  You may obtain a copy of the License at
9
 *
10
 *   http://www.apache.org/licenses/LICENSE-2.0
11
 *
12
 * Unless required by applicable law or agreed to in writing,
13
 * software distributed under the License is distributed on an
14
 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15
 * KIND, either express or implied.  See the License for the
16
 * specific language governing permissions and limitations
17
 * under the License.
18
 */
19

20
package org.commonwl.view;
21

22
import java.util.Collections;
23
import org.commonwl.view.workflow.MultipleWorkflowsException;
24
import org.commonwl.view.workflow.RepresentationNotFoundException;
25
import org.commonwl.view.workflow.WorkflowNotFoundException;
26
import org.springframework.http.HttpHeaders;
27
import org.springframework.http.HttpStatus;
28
import org.springframework.http.MediaType;
29
import org.springframework.http.ResponseEntity;
30
import org.springframework.web.bind.annotation.ControllerAdvice;
31
import org.springframework.web.bind.annotation.ExceptionHandler;
32

33
/**
34
 * Handles exception handling across the application.
35
 *
36
 * <p>Because of Spring Boot's content negotiation these handlers are needed when the error is
37
 * returned with an otherwise "non acceptable" content type (e.g. Accept: image/svg+xml but we have
38
 * to say 404 Not Found)
39
 */
40
@ControllerAdvice
41
public class GlobalControllerErrorHandling {
×
42

43
  /**
44
   * Workflow can not be found
45
   *
46
   * @return A plain text error message
47
   */
48
  @ExceptionHandler(WorkflowNotFoundException.class)
49
  public ResponseEntity<?> handleNotFound() {
50
    final HttpHeaders headers = new HttpHeaders();
×
51
    headers.setContentType(MediaType.TEXT_PLAIN);
×
52
    return new ResponseEntity<>(
×
53
        "Workflow or git commit could not be found", headers, HttpStatus.NOT_FOUND);
54
  }
55

56
  /**
57
   * More than one workflow (or workflow parts) found
58
   *
59
   * @return A text/uri-list of potential representations
60
   */
61
  @ExceptionHandler(MultipleWorkflowsException.class)
62
  public ResponseEntity<?> handleMultipleWorkflows(MultipleWorkflowsException ex) {
63
    final HttpHeaders headers = new HttpHeaders();
×
64
    headers.setContentType(MediaType.parseMediaType("text/uri-list"));
×
65
    return new ResponseEntity<>(ex.toString(), headers, HttpStatus.MULTIPLE_CHOICES);
×
66
  }
67

68
  /**
69
   * Workflow exists but representation is not found eg Generic git workflow asking for raw workflow
70
   * URL
71
   *
72
   * @return A plain text error message
73
   */
74
  @ExceptionHandler(RepresentationNotFoundException.class)
75
  public ResponseEntity<?> handleNoRepresentation() {
76
    final HttpHeaders headers = new HttpHeaders();
×
77
    headers.setVary(Collections.singletonList("Accept"));
×
78
    headers.setContentType(MediaType.TEXT_PLAIN);
×
79
    return new ResponseEntity<>(
×
80
        "The workflow exists but the requested representation could not be found",
81
        headers,
82
        HttpStatus.NOT_ACCEPTABLE);
83
  }
84
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc