BETA Shoulder is in beta — Findings may sometimes be wrong. Your feedback shapes what we fix next. Share feedback

Unchecked Return Value from Critical Operations

Description

Detects critical operations (file system, database, authentication) whose return values are not checked. Ignoring return values can lead to silent failures, data corruption, and security vulnerabilities. Critical operations that must have their return values checked include: - File system operations (write, delete, chmod) - Database operations (insert, update, delete) - Authentication/authorization checks - Cryptographic operations

What Shoulder detects

Return value from {operation} at {location} is not checked

How to fix

Always check return values from critical operations:

```javascript
// ✅ SAFE - Check return value
const result = await fs.writeFile(path, data);
if (!result.success) {
  logger.error('Write failed');
  throw new Error('Failed to write file');
}
```

Applies to

Frameworks

nodejs express fastify nextjs

References

Scan for this issue

Detect with Shoulder CLI
npx @shoulderdev/cli trust --rule=javascript-unchecked-return-value .

Related rules