Method ParseOrThrow
- Namespace
- IntentSharp.Guardrails
- Assembly
- IntentSharp.Guardrails.dll
ParseOrThrow(IReadOnlyList<KeyValuePair<string, string>>, GuardrailSourceOptions?)
Reads rule files and compiled companions as Parse(IReadOnlyList<KeyValuePair<string, string>>, GuardrailSourceOptions?) does, and throws when any document has a problem,
so a test fails with every path:line: message in one message.
public static GuardrailFileSet ParseOrThrow(IReadOnlyList<KeyValuePair<string, string>> documents, GuardrailSourceOptions? options = null)
Parameters
documentsIReadOnlyList<KeyValuePair<string, string>>Each document's path, relative to its store's root, and its text.
optionsGuardrailSourceOptionsThe kinds, subjects and settings a rule file may name beyond the library's own, and the code settings; null for none.
Returns
- GuardrailFileSet
The sets, when every document loaded.
Exceptions
- GuardrailLoadException
A document has a problem; Problems lists them all.
- ArgumentNullException
documents, a path or a text is null.- ArgumentException
A path is not a document path, or a code setting is not declared or not valid.