Skip to content
Critiq Docs

Search docs

Search documentation pages and rules

correctness.async

Reject or throw non-Error values

Promise rejections and async throws should use Error objects.

#Metadata

Rule ID
ts.correctness.promise-reject-non-error
Severity
medium
Confidence
0.9
Languages
javascript, typescript
Presets
recommended, strict
Stability
stable
Applies to
file
Tags
async, correctness, crq-cor-033, rules-catalog

#Why it matters

Non-Error rejections lose stack traces and are harder to handle consistently in async code.

#Remediation

Reject or throw `new Error(...)` (or a typed Error subclass) instead of a string or other primitive.

#Repository path

The generated metadata points to critiq-rules/libs/rules/catalog/rules/typescript/ts.correctness.promise-reject-non-error.rule.yaml.