1#ifndef SOURCEMETA_CORE_PROCESS_ERROR_H_
2#define SOURCEMETA_CORE_PROCESS_ERROR_H_
4#ifndef SOURCEMETA_CORE_PROCESS_EXPORT
5#include <sourcemeta/core/process_export.h>
9#include <initializer_list>
16namespace sourcemeta::core {
22#pragma warning(disable : 4251 4275)
28 :
public std::exception {
34 [[nodiscard]]
auto what() const noexcept -> const
char *
override {
35 return "Could not locate the requested program";
39 [[nodiscard]]
auto program() const noexcept -> std::string_view {
40 return this->program_;
53 std::initializer_list<std::string_view>
arguments)
58 std::span<const std::string_view>
arguments)
61 [[nodiscard]]
auto what() const noexcept -> const
char *
override {
62 return "Process terminated abnormally";
66 [[nodiscard]]
auto program() const noexcept -> std::string_view {
67 return this->program_;
72 -> const std::vector<std::
string> & {
73 return this->arguments_;
78 std::vector<std::string> arguments_;
82#pragma warning(default : 4251 4275)
ProcessSpawnError(const std::string_view program, std::span< const std::string_view > arguments)
Construct the error given the offending program and its arguments.
Definition process_error.h:57
auto arguments() const noexcept -> const std::vector< std::string > &
The arguments the program was spawned with.
Definition process_error.h:71
auto program() const noexcept -> std::string_view
The offending program.
Definition process_error.h:39
ProcessProgramNotFoundError(const std::string_view program)
Construct the error given the offending program.
Definition process_error.h:31
ProcessSpawnError(const std::string_view program, std::initializer_list< std::string_view > arguments)
Construct the error given the offending program and its arguments.
Definition process_error.h:52
auto program() const noexcept -> std::string_view
The offending program.
Definition process_error.h:66