qerrors
Version:
Intelligent error handling middleware with AI-powered analysis, environment validation, caching, and production-ready logging. Provides OpenAI-based error suggestions, queue management, retry mechanisms, and comprehensive configuration options for Node.js
10 lines (8 loc) • 444 B
JavaScript
// axios stub used in tests to prevent actual HTTP requests
function stubPost() { //default unmocked post throws to catch stray calls
throw new Error('axios.post not stubbed'); //fail fast if not stubbed
}
module.exports = {
post: async () => { stubPost(); }, //simulate axios.post for tests
create: (opts = {}) => ({ post: async () => { stubPost(); }, defaults: opts }) //mimic axios.create returning instance with post and defaults
};