rusp_lib/
usp_errors.rs

1/// Gets an USP error message from the error code, returning an empty str for unknown codes
2#[must_use]
3pub const fn get_err_msg(code: u32) -> &'static str {
4    match code {
5        7000 => "Message failed",
6        7001 => "Message not supported",
7        7002 => "Request denied (no reason specified)",
8        7003 => "Internal error",
9        7004 => "Invalid arguments",
10        7005 => "Resources exceeded",
11        7006 => "Permission denied",
12        7007 => "Invalid configuration",
13        7008 => "Invalid path syntax",
14        7009 => "Parameter action failed",
15        7010 => "Unsupported parameter",
16        7011 => "Invalid type",
17        7012 => "Invalid value",
18        7013 => "Attempt to update non-writeable parameter",
19        7014 => "Value conflict",
20        7015 => "Operation error",
21        7016 => "Object does not exist",
22        7017 => "Object could not be created",
23        7018 => "Object is not a table",
24        7019 => "Attempt to create non-creatable Object",
25        7020 => "Object could not be updated",
26        7021 => "Required parameter failed",
27        7022 => "Command failure",
28        7023 => "Command canceled",
29        7024 => "Delete failure",
30        7025 => "Object exists with duplicate key",
31        7026 => "Invalid path",
32        7027 => "Invalid command arguments",
33        7028 => "Register failure",
34        7029 => "Already in use",
35        7030 => "Deregister failure",
36        7031 => "Path already registered",
37        7100 => "Record could not be parsed",
38        7101 => "Secure session required",
39        7102 => "Secure session not supported",
40        7103 => "Segmentation and reassembly not supported",
41        7104 => "Invalid Record value",
42        7105 => "Session Context terminated",
43        7106 => "Session Context not allowed",
44        7800..=7999 => "Vendor specific",
45        // Includes `7032..=7099 | 7107..=7799` too
46        _ => "",
47    }
48}