Skip to content

Commit f987e21

Browse files
committed
feat: removed unneeded error types
1 parent fdac187 commit f987e21

2 files changed

Lines changed: 0 additions & 45 deletions

File tree

crates/cli/src/diagnostics/diagnose.rs

Lines changed: 0 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -23,24 +23,10 @@ impl Diagnose {
2323
pub fn print(&self) -> String {
2424
let path = format!("{}:{}:{}", Path::new(&self.definition.path).display(), 1, 1);
2525
match &self.kind {
26-
EmptyGenericMapper => error(
27-
format!(
28-
"`{}` defined a generic_type but its mapper are empty!`",
29-
self.definition_name
30-
),
31-
&path,
32-
),
3326
DeserializationError { description } => error(
3427
format!("A JSON paring error occurred: `{}`", description),
3528
&path,
3629
),
37-
GenericKeyNotInMappingTarget { key, target } => error(
38-
format!(
39-
"`{}` is mapping the key: {} onto the target: {}. But the target did not define this generic_key!",
40-
self.definition_name, key, target
41-
),
42-
&path,
43-
),
4430
DuplicateDataTypeIdentifier { identifier } => error(
4531
format!(
4632
"The data_type `{}` is already defined resulting in a duplicate!",
@@ -83,27 +69,6 @@ impl Diagnose {
8369
),
8470
&path,
8571
),
86-
ForbiddenVariant => error(
87-
format!(
88-
"The data_type variant of `{}` is 0 and thus incorrect!",
89-
self.definition_name
90-
),
91-
&path,
92-
),
93-
UnusedGenericKey { key } => error(
94-
format!(
95-
"`{}` defined a generic_key (`{}`) that is never used!",
96-
self.definition_name, key
97-
),
98-
&path,
99-
),
100-
UndefinedGenericKey { key } => error(
101-
format!(
102-
"`{}` uses a generic_key (`{}`) that's not defined!",
103-
self.definition_name, key
104-
),
105-
&path,
106-
),
10772
UndefinedTranslation { translation_field } => warning(
10873
format!(
10974
"`{}` has an empty field (`{}`) of translations!",

crates/cli/src/diagnostics/kinds.rs

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,7 @@ pub enum DiagnosticKind {
88
DuplicateRuntimeFunctionIdentifier { identifier: String },
99
DuplicateRuntimeParameterIdentifier { identifier: String },
1010
UndefinedDataTypeIdentifier { identifier: String },
11-
EmptyGenericMapper,
12-
GenericKeyNotInMappingTarget { key: String, target: String },
1311
NullField { field_name: String },
14-
ForbiddenVariant,
15-
UnusedGenericKey { key: String },
16-
UndefinedGenericKey { key: String },
1712
UndefinedTranslation { translation_field: String },
1813
MissingTranslation { translation_field: String },
1914
}
@@ -27,13 +22,8 @@ impl DiagnosticKind {
2722
| DuplicateFlowTypeIdentifier { .. }
2823
| DuplicateRuntimeFunctionIdentifier { .. }
2924
| DuplicateRuntimeParameterIdentifier { .. }
30-
| GenericKeyNotInMappingTarget { .. }
31-
| EmptyGenericMapper
3225
| UndefinedDataTypeIdentifier { .. }
3326
| NullField { .. }
34-
| ForbiddenVariant
35-
| UnusedGenericKey { .. }
36-
| UndefinedGenericKey { .. }
3727
| MissingTranslation { .. } => Severity::Error,
3828
UndefinedTranslation { .. } => Severity::Warning,
3929
}

0 commit comments

Comments
 (0)