wavelength 1.0.0
Loading...
Searching...
No Matches
imageerror.h
Go to the documentation of this file.
1#pragma once
2
3#include <expected>
4#include <string>
5#include <utility>
6
7#include "error.h"
8
9namespace Tools::Common {
10
17inline std::unexpected<Error> invalidInput(std::string message) {
18 return std::unexpected(Error{ErrorCode::InvalidInput, std::move(message)});
19}
20
27inline std::unexpected<Error> discImageError(std::string message) {
28 return invalidInput(std::move(message));
29}
30
37inline std::unexpected<Error> artifactError(std::string message) {
38 return std::unexpected(Error{ErrorCode::Network, std::move(message)});
39}
40
47inline std::unexpected<Error> ioError(std::string message) {
48 return std::unexpected(Error{ErrorCode::Io, std::move(message)});
49}
50
51} // namespace Tools::Common
Code that the host tools share.
Definition byteorder.h:7
std::unexpected< Error > invalidInput(std::string message)
Report that an input file does not have the expected format.
Definition imageerror.h:17
std::unexpected< Error > artifactError(std::string message)
Report that build artifacts cannot be fetched from GitHub.
Definition imageerror.h:37
@ Io
Definition error.h:11
@ InvalidInput
Definition error.h:10
@ Network
Definition error.h:12
std::unexpected< Error > discImageError(std::string message)
Report that the disc image cannot be read or rewritten.
Definition imageerror.h:27
std::unexpected< Error > ioError(std::string message)
Report that a file cannot be read or written.
Definition imageerror.h:47
Failure returned through std::expected.
Definition error.h:17