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

mendersoftware / mender / 1022567176

02 Oct 2023 07:50AM UTC coverage: 80.127% (+2.5%) from 77.645%
1022567176

push

gitlab-ci

kacf
chore: Centralize selection of `std::filesystem` library.

Signed-off-by: Kristian Amlie <kristian.amlie@northern.tech>

6447 of 8046 relevant lines covered (80.13%)

9912.21 hits per line

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

38.46
/artifact/v3/scripts/error.cpp
1
// Copyright 2023 Northern.tech AS
2
//
3
//    Licensed under the Apache License, Version 2.0 (the "License");
4
//    you may not use this file except in compliance with the License.
5
//    You may obtain a copy of the License at
6
//
7
//        http://www.apache.org/licenses/LICENSE-2.0
8
//
9
//    Unless required by applicable law or agreed to in writing, software
10
//    distributed under the License is distributed on an "AS IS" BASIS,
11
//    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
//    See the License for the specific language governing permissions and
13
//    limitations under the License.
14

15
#include <artifact/v3/scripts/error.hpp>
16

17
#include <cassert>
18

19
#include <string>
20

21
namespace mender {
22
namespace artifact {
23
namespace scripts {
24
namespace executor {
25

26
using namespace std;
27

28
const ErrorCategoryClass ErrorCategory;
29

30
const char *ErrorCategoryClass::name() const noexcept {
×
31
        return "ArtifactScriptExecutorCategory";
×
32
}
33

34
string ErrorCategoryClass::message(int code) const {
49✔
35
        switch (code) {
49✔
36
        case NoError:
37
                return "Success";
×
38
        case VersionFileError:
39
                return "Version file error";
×
40
        case SetupError:
41
                return "Setup error";
×
42
        case CollectionError:
43
                return "Failed to collect the scripts";
×
44
        case NonZeroExitStatusError:
45
                return "NonZero exit code error";
49✔
46
        case RetryExitCodeError:
47
                return "Retry exit code error";
×
48
        }
49
        assert(false);
50
        return "Unknown";
×
51
}
52

53
error::Error MakeError(Code code, const string &msg) {
45✔
54
        return error::Error(error_condition(code, ErrorCategory), msg);
45✔
55
}
56

57
} // namespace executor
58
} // namespace scripts
59
} // namespace artifact
60
} // namespace mender
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