Commit 31c699b
committed
Panic on unexpected schema validation error
The `err` return value of `*jsonschema.Schema.ValidateInterface()` is used to pass the schema validation failure result.
That error type is given special treatment by Arduino Lint because it occurs under normal circumstances when a rule
violation occurs, and must be interpreted by the rule functions, or even ignored, depending on the tool configuration.
The `err` return value of `*jsonschema.Schema.ValidateInterface()` is also used to return errors that indicate some
unexpected problem has occurred separate from a schema validation failure. Previously, these other error types were
ignored and the validation treated as if it had passed, even though it likely never even ran.
Since Arduino Lint controls both the instance and schema data, such these true errors returned by the validation process
should not ever occur when the application is operating correctly. For this reason, a panic is triggered immediately.1 parent a4c8fdc commit 31c699b
1 file changed
+10
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
81 | 81 | | |
82 | 82 | | |
83 | 83 | | |
84 | | - | |
85 | 84 | | |
86 | | - | |
| 85 | + | |
87 | 86 | | |
88 | 87 | | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
89 | 97 | | |
90 | 98 | | |
91 | 99 | | |
| |||
0 commit comments