CARDS 2.4.140
Package manager for the NuTyX GNU/Linux distribution
error_treat.h
1//
2// error_treat.h
3//
4// Copyright (c) 2014 - 2020 by NuTyX team (http://nutyx.org)
5//
6// This program is free software; you can redistribute it and/or modify
7// it under the terms of the GNU General Public License as published by
8// the Free Software Foundation; either version 2 of the License, or
9// (at your option) any later version.
10//
11// This program is distributed in the hope that it will be useful,
12// but WITHOUT ANY WARRANTY; without even the implied warranty of
13// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14// GNU General Public License for more details.
15//
16// You should have received a copy of the GNU General Public License
17// along with this program; if not, write to the Free Software
18// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
19// USA.
20//
21
22#ifndef ERRORTREAT_H
23#define ERRORTREAT_H
24
25#include "system_utils.h"
26
27#include <cstring>
28
29#define RED "\033[1;31m"
30#define GREEN "\033[1;32m"
31#define YELLOW "\033[1;33m"
32#define BLUE "\033[1;34m"
33#define MAGENTA "\033[1;35m"
34#define CYAN "\033[1;36m"
35#define WHITE "\033[1;37m"
36#define NORMAL "\033[1;0m"
37
38#define ACTION _("\033[1;33maction:\033[1;0m")
39#define USAGE _("\033[1;33musage: \033[1;0m")
40#define OPTIONS _("\033[1;33moptions\033[1;0m")
41#define REQUIRED _("\033[1;33mrequired\033[1;0m")
42#define DESCRIPTION _("\033[1;33mdescription: \033[1;0m")
43#define COMMAND _("\033[1;34mcommand\033[1;0m")
44
45
46enum error
47{
48CANNOT_FIND_DEPOT,
49CANNOT_DOWNLOAD_FILE,
50CANNOT_CREATE_FILE,
51CANNOT_OPEN_FILE,
52CANNOT_FIND_FILE,
53CANNOT_READ_FILE,
54CANNOT_COPY_FILE,
55CANNOT_PARSE_FILE,
56CANNOT_READ_DIRECTORY,
57CANNOT_WRITE_FILE,
58CANNOT_SYNCHRONIZE,
59CANNOT_RENAME_FILE,
60CANNOT_DETERMINE_NAME_BUILDNR,
61WRONG_ARCHITECTURE,
62EMPTY_PACKAGE,
63CANNOT_FORK,
64WAIT_PID_FAILED,
65DATABASE_LOCKED,
66CANNOT_LOCK_DIRECTORY,
67CANNOT_REMOVE_FILE,
68CANNOT_CREATE_DIRECTORY,
69CANNOT_RENAME_DIRECTORY,
70OPTION_ONE_ARGUMENT,
71INVALID_OPTION,
72OPTION_MISSING,
73TOO_MANY_OPTIONS,
74ONLY_ROOT_CAN_INSTALL_UPGRADE_REMOVE,
75PACKAGE_NOT_EXIST,
76PACKAGE_NOT_FOUND,
77PACKAGE_ALLREADY_INSTALL,
78PACKAGE_NOT_INSTALL,
79PACKAGE_NOT_PREVIOUSLY_INSTALL,
80LISTED_FILES_ALLREADY_INSTALLED,
81PKGADD_CONFIG_LINE_TOO_LONG,
82PKGADD_CONFIG_WRONG_NUMBER_ARGUMENTS,
83PKGADD_CONFIG_UNKNOWN_ACTION,
84PKGADD_CONFIG_UNKNOWN_EVENT,
85CANNOT_COMPILE_REGULAR_EXPRESSION,
86CANNOT_GENERATE_LEVEL,
87NOT_INSTALL_PACKAGE_NEITHER_PACKAGE_FILE
88};
89
90class RunTimeErrorWithErrno : public std::runtime_error
91{
92 public:
93 explicit RunTimeErrorWithErrno(const std::string& msg) throw();
94 explicit RunTimeErrorWithErrno(const std::string& msg, int e) throw();
95};
96#endif /* ERRORTREAT_H */
97// vim:set ts=2 :
Definition: error_treat.h:91