Resl1005 Consider Domain Error Info
title: RESL1005 — Consider Domain Error [Info]
// ⚠️ RESL1005: Consider using 'NotFoundError' instead of 'Error' — it carries HTTP status context
// and integrates automatically with 'ToIResult()'
return Result<User>.Fail(new Error("user not found"));
// ✅ Domain-specific — sets HttpStatusCode=404 automatically, ToIResult() maps it correctly:
return Result<User>.Fail(new NotFoundError("user not found"));
Triggers when the message string implies a known HTTP error category:
| Keyword(s) in message | Suggested type |
|---|---|
not found, missing |
NotFoundError |
conflict, already exists |
ConflictError |
unauthorized |
UnauthorizedError |
forbidden, access denied |
ForbiddenError |
invalid, validation |
ValidationError |