1crate::diagnostic_codes! {
4 REQUEST_DIAGNOSTIC_INVALID_CODE = "REQUEST.DIAGNOSTIC.INVALID_CODE", Error,
5 "a diagnostic code does not match the stable code grammar", category = Request;
6 REQUEST_DIAGNOSTIC_MISSING_CATEGORY = "REQUEST.DIAGNOSTIC.MISSING_CATEGORY", Error,
7 "an error was constructed from a registry entry without an error category", category = Request;
8 REQUEST_RECORD_INVALID_IDENTIFIER = "REQUEST.RECORD.INVALID_IDENTIFIER", Error,
9 "a common record identifier is empty, contains NUL, or exceeds its bound", category = Request;
10 REQUEST_RECORD_INVALID_POINTER = "REQUEST.RECORD.INVALID_POINTER", Error,
11 "a source map or diagnostic target is not an RFC 6901 pointer", category = Request;
12 REQUEST_RECORD_INVALID_DIGEST = "REQUEST.RECORD.INVALID_DIGEST", Error,
13 "a source digest is not valid for its declared algorithm", category = Request;
14 REQUEST_RECORD_INVALID_SPAN = "REQUEST.RECORD.INVALID_SPAN", Error,
15 "a source span is reversed or outside its declared source", category = Request;
16 REQUEST_RECORD_DUPLICATE_ID = "REQUEST.RECORD.DUPLICATE_ID", Error,
17 "a module record repeats an existing local identity", category = Request;
18 REQUEST_RECORD_INVALID_EXTENSION = "REQUEST.RECORD.INVALID_EXTENSION", Error,
19 "an extension key is not namespaced", category = Request;
20 REQUEST_RECORD_TOO_LARGE = "REQUEST.RECORD.TOO_LARGE", Error,
21 "a stored record exceeds a bound the constructors enforce", category = Request;
22 REQUEST_RECORD_ALLOCATION_REFUSED = "REQUEST.RECORD.ALLOCATION_REFUSED", Error,
23 "the record identity index cannot reserve memory for the stated count", category = Request;
24
25 REQUEST_FORMAT_INVALID_ID = "REQUEST.FORMAT.INVALID_ID", Error,
26 "a format identifier does not match the stable format grammar", category = Request;
27
28 REQUEST_SOURCE_INVALID_NAME = "REQUEST.SOURCE.INVALID_NAME", Error,
29 "an in-memory source name is empty, contains NUL, or exceeds its bound", category = Request;
30 REQUEST_SOURCE_INVALID_PATH = "REQUEST.SOURCE.INVALID_PATH", Error,
31 "a source path is empty or does not name a regular file or directory", category = Request;
32 REQUEST_SOURCE_SYMLINK_REFUSED = "REQUEST.SOURCE.SYMLINK_REFUSED", Error,
33 "source acquisition refused a symbolic link", category = Request;
34 REQUEST_SOURCE_NOT_A_FILE = "REQUEST.SOURCE.NOT_A_FILE", Error,
35 "source acquisition refused an entry that is not a regular file", category = Request;
36 REQUEST_SOURCE_DIRECTORY_REQUIRED = "REQUEST.SOURCE.DIRECTORY_REQUIRED", Error,
37 "a named child buffer was requested from a single-buffer source", category = Request;
38 REQUEST_SOURCE_ESCAPES_ROOT = "REQUEST.SOURCE.ESCAPES_ROOT", Error,
39 "a referenced file resolves outside the acquisition root", category = Request;
40 REQUEST_SOURCE_UNKNOWN_BUFFER = "REQUEST.SOURCE.UNKNOWN_BUFFER", Error,
41 "a referenced buffer was not supplied to an in-memory source", category = Request;
42
43 READ_IO_METADATA = "READ.IO.METADATA", Error,
44 "source metadata could not be read", category = Io;
45 READ_IO_OPEN = "READ.IO.OPEN", Error,
46 "a source buffer could not be opened", category = Io;
47 READ_IO_READ = "READ.IO.READ", Error,
48 "a source buffer could not be read completely", category = Io;
49 READ_IO_SOURCE_CHANGED = "READ.IO.SOURCE_CHANGED", Error,
50 "a source buffer changed while it was being acquired", category = Io;
51 READ_IO_ALLOCATION_REFUSED = "READ.IO.ALLOCATION_REFUSED", Error,
52 "memory for a source buffer could not be reserved", category = Io;
53 READ_IO_REFERENCE_BUDGET = "READ.IO.REFERENCE_BUDGET", Error,
54 "acquiring another referenced file would pass the source acquisition budget", category = Io;
55
56 VALIDATE_TIME_POINT_INVALID_LABEL = "VALIDATE.TIME_POINT.INVALID_LABEL", Error,
57 "a time point label is empty, contains NUL, or exceeds its bound", category = Data;
58 VALIDATE_TIME_POINT_INVALID_DURATION = "VALIDATE.TIME_POINT.INVALID_DURATION", Error,
59 "a time point duration has an invalid nanosecond remainder", category = Data;
60 VALIDATE_TIME_SERIES_SHAPE = "VALIDATE.TIME_SERIES.SHAPE", Error,
61 "time point and value counts differ", category = Data;
62 VALIDATE_TIME_SERIES_DIMENSION_OVERFLOW = "VALIDATE.TIME_SERIES.DIMENSION_OVERFLOW", Error,
63 "the product of two data dimensions exceeds usize", category = Data;
64
65 VALIDATE_SCENARIO_INVALID_ID = "VALIDATE.SCENARIO.INVALID_ID", Error,
66 "a scenario identity is empty, contains NUL, or exceeds its bound", category = Data;
67 VALIDATE_SCENARIO_DUPLICATE_ID = "VALIDATE.SCENARIO.DUPLICATE_ID", Error,
68 "a scenario set repeats a case-sensitive scenario identity", category = Data;
69 VALIDATE_SCENARIO_MISSING_PROBABILITY = "VALIDATE.SCENARIO.MISSING_PROBABILITY", Error,
70 "a scenario set supplies probabilities for only some entries", category = Data;
71 VALIDATE_SCENARIO_INVALID_PROBABILITY = "VALIDATE.SCENARIO.INVALID_PROBABILITY", Error,
72 "a scenario probability is negative or nonfinite", category = Data;
73 VALIDATE_SCENARIO_PROBABILITY_SUM = "VALIDATE.SCENARIO.PROBABILITY_SUM", Error,
74 "scenario probabilities do not sum to one within the required tolerance", category = Data;
75 VALIDATE_SCENARIO_ALLOCATION_REFUSED = "VALIDATE.SCENARIO.ALLOCATION_REFUSED", Error,
76 "memory for scenario identity validation could not be reserved", category = Data;
77
78 REQUEST_OUTPUT_INVALID_ARTIFACT_PATH = "REQUEST.OUTPUT.INVALID_ARTIFACT_PATH", Error,
79 "an artifact path is not a portable nonempty relative path", category = Request;
80 REQUEST_OUTPUT_INVALID_LAYOUT = "REQUEST.OUTPUT.INVALID_LAYOUT", Error,
81 "an artifact inventory does not match the requested output layout", category = Request;
82 REQUEST_OUTPUT_DUPLICATE_ARTIFACT = "REQUEST.OUTPUT.DUPLICATE_ARTIFACT", Error,
83 "an artifact inventory repeats a path", category = Request;
84 REQUEST_OUTPUT_COLLISION = "REQUEST.OUTPUT.COLLISION", Error,
85 "an output target already exists", category = Request;
86 EMIT_IO_STAGING = "EMIT.IO.STAGING", Error,
87 "a sibling output staging path could not be created", category = Io;
88 EMIT_IO_WRITE = "EMIT.IO.WRITE", Error,
89 "an output artifact could not be written", category = Io;
90 EMIT_IO_COMMIT = "EMIT.IO.COMMIT", Error,
91 "a complete staged output could not be moved into place", category = Io;
92 EMIT_IO_CLEANUP = "EMIT.IO.CLEANUP", Error,
93 "an incomplete output staging path could not be removed", category = Io;
94}
95
96pub use ALL as CORE_DIAGNOSTIC_CODES;
97
98#[cfg(test)]
99mod tests {
100 #[test]
101 fn core_registry_is_valid() {
102 assert_eq!(
103 crate::check_registry(super::ALL.iter().copied()),
104 Vec::<String>::new()
105 );
106 }
107}