[TSV][BUG]TspValidate returns a silent error if a `validate()` function returns `{ success: false}`.
- Dominant language
- C#
- Stars
- 135
- Forks
- 260
- Avg merge
- 3d 1h
- Merged PRs (30d)
- 144
Description
### API Spec link
https://github.com/azure-rest-api-specs/eng/tools
### API Spec version
0
### Describe the bug
Currently the validate function returns:
```typescript
protected abstract validate(config: any): RuleResult;
export interface RuleResult {
readonly success: boolean;
readonly stdOutput?: string;
readonly errorOutput?: string;
}
```
The problem here is that if a `validate()` function returns `{success:false}` then the validation fails with no diagnostic.
Two possible solutions have been proposed:
```typescript
export interface RuleResult {
readonly success: boolean;
readonly reason: string; // success or failure reason
}
```
or
```typescript
RuleResult = {success: true; } | {success: false; reason: string };
```
### Expected behavior
Validation failures always have an error attached to them.
### Actual behavior
Validation failures sometimes don't have an error message
### Reproduction Steps
See above.
### Environment
_No response_
Contributor guide
Assessment
This issue has not been assessed yet.