Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
return new Promise(resolve =>
setTimeout(resolve, 3000)
);
}
@Injectable()
class ServerErrorMiddleware implements ErrorMiddleware {
async use(error, _req, res) {
await emulatedRequest();
res.status(500).send(error.toString());
}
}
@Controller('/')
class UserController {
@Get('/')
getData(@Response() res) {
throw new Error('Handler error');
}
}
/**
* Server configuration
*/
const app: express.Express = express();
app.set('env', 'test');