• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

statuscompliance / status-backend / 14621377209

23 Apr 2025 02:57PM UTC coverage: 44.615% (+0.6%) from 44.013%
14621377209

Pull #123

github

web-flow
Merge 73cbf3074 into a5c98d299
Pull Request #123: test (endpoint): added middleware

290 of 768 branches covered (37.76%)

Branch coverage included in aggregate %.

1 of 6 new or added lines in 2 files covered. (16.67%)

13 existing lines in 2 files now uncovered.

787 of 1646 relevant lines covered (47.81%)

6.0 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/src/middleware/errorHandler.js
1
import { CacheLoadError, ConfigurationNotFoundError, AssistantFetchError } from './endpoint.js';
2

3
// eslint-disable-next-line no-unused-vars
4
export function errorHandler(err, req, res, next) {
NEW
5
  console.error('Error:', err);
×
6

NEW
7
  if (err instanceof CacheLoadError || 
×
8
      err instanceof ConfigurationNotFoundError || 
9
      err instanceof AssistantFetchError) {
NEW
10
    return res.status(err.statusCode).json({
×
11
      message: err.name,
12
      error: err.message
13
    });
14
  }
15

NEW
16
  const statusCode = err.statusCode || 500;
×
17
  
NEW
18
  return res.status(statusCode).json({
×
19
    message: err.name || 'Internal server error',
×
20
    error: process.env.NODE_ENV === 'production' ? 'Something went wrong' : err.message
×
21
  });
22
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc