ErrorCode.h
Go to the documentation of this file.
1 /****
2  * ErrorCode.h
3  *
4  * Copyright 2020 mikee47 <mike@sillyhouse.net>
5  *
6  * This file is part of the Sming UPnP Library
7  *
8  * This library is free software: you can redistribute it and/or modify it under the terms of the
9  * GNU General Public License as published by the Free Software Foundation, version 3 or later.
10  *
11  * This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
12  * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
13  * See the GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License along with this library.
16  * If not, see <https://www.gnu.org/licenses/>.
17  *
18  ****/
19 
20 #pragma once
21 
22 #include <WString.h>
23 
27 #define UPNP_ERRORCODE_MAP(XX) \
28  XX(0, None, "No Error", "") \
29  XX(401, InvalidAction, "Invalid Action", "No action by that name at this service") \
30  XX(402, InvalidArgs, "Invalid Args", \
31  "Could be any of the following:\n" \
32  " - Not enough in args\n" \
33  " - Args in the wrong order\n" \
34  " - One or more in args are of the wrong data type\n" \
35  "Additionally, the UPnP Certification Test Tool shall return the following warning" \
36  " message if there are too many in args:\n" \
37  " 'Sending too many in args is not recommended and may cause unexpected results.'") \
38  XX(501, ActionFailed, "Action Failed", "Current state of service prevents invoking the action") \
39  XX(600, ArgumentValueInvalid, "Argument Value Invalid", "The argument value is invalid") \
40  XX(601, ArgumentValueOutOfRange, "Argument Value Out of Range", \
41  "An argument value is less than the minimum or more than the maximum value" \
42  " of the allowed value range, or is not in the allowed value list.") \
43  XX(602, OptionalActionNotImplemented, "Optional Action Not Implemented", \
44  "The requested action is optional and is not implemented by the device") \
45  XX(603, OutOfMemory, "Out of Memory", \
46  "The device does not have sufficient memory available to complete the action." \
47  " This is allowed to be a temporary condition; the control point is allowed to choose to retry" \
48  " the unmodified request again later and it is expected to succeed if memory is available.") \
49  XX(604, HumanInterventionRequired, "Human Intervention Required", \
50  "The device has encountered an error condition which it cannot resolve" \
51  " itself and required human intervention such as a reset or power cycle." \
52  " See the device display or documentation for further guidance.") \
53  XX(605, StringArgumentTooLong, "String Argument Too Long", \
54  "A string argument is too long for the device to handle properly")
55 
56 namespace UPnP
57 {
58 enum class ErrorCode {
59 #define XX(code, tag, text, description) tag = code,
61 #undef XX
62 };
63 
64 } // namespace UPnP
65 
String toString(UPnP::ErrorCode error)
String toLongString(UPnP::ErrorCode error)
#define UPNP_ERRORCODE_MAP(XX)
UPnP defined action error codes.
Definition: ErrorCode.h:27
The String class.
Definition: WString.h:137
Definition: ActionRequest.h:25
ErrorCode
Definition: ErrorCode.h:58
XX(code, tag, text, description)