Project

General

Profile

Download (1.09 KB) Statistics
| Branch: | Tag: | Revision:
1
/**
2
* Copyright (C) 2020 EDIT
3
* European Distributed Institute of Taxonomy
4
* http://www.e-taxonomy.eu
5
*
6
* The contents of this file are subject to the Mozilla Public License Version 1.1
7
* See LICENSE.TXT at the top of this package for the full license terms.
8
*/
9
package eu.etaxonomy.drush;
10

    
11
import java.util.List;
12
import java.util.stream.Collectors;
13

    
14
/**
15
 * @author a.kohlbecker
16
 * @since Aug 14, 2020
17
 */
18
public class DrushExecutionFailure extends Exception {
19

    
20
    String out, error, commandLineString;
21

    
22
    /**
23
     * @param cmd
24
     * @param out
25
     * @param error
26
     * @param matches
27
     */
28
    public DrushExecutionFailure(List<String> cmd, String out, String error) {
29
        this.out = out;
30
        this.error = error;
31
        this.commandLineString = cmd.stream().collect(Collectors.joining(" "));
32
    }
33

    
34
    @Override
35
    public String getMessage() {
36
        return "'" + commandLineString + "' failed with '" + error + "'";
37

    
38
    }
39

    
40
    @Override
41
    public String getLocalizedMessage() {
42
        return getMessage();
43

    
44
    }
45

    
46

    
47

    
48
    private static final long serialVersionUID = -4840009591742936935L;
49

    
50
}
(2-2/2)