{"record":{"id":"e229e299a3c581c4","repo":"balderdashy/sails","slug":"the-2-ary-usage-of-res-send-is-no-longer-suppo","errorCode":null,"errorMessage":"The 2-ary usage of `res.send()` is no longer supported in Express 4/Sails v1.  Please use `res.status(statusCode).send(body)` instead.","messagePattern":"The 2-ary usage of `res\\.send\\(\\)` is no longer supported in Express 4/Sails v1\\.  Please use `res\\.status\\(statusCode\\)\\.send\\(body\\)` instead\\.","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"lib/router/res.js","lineNumber":198,"sourceCode":"\n    // Get the status codes from the HTTP module\n    var statusCodes = http.STATUS_CODES;\n\n    // If this is a known code, use its name (e.g. \"FORBIDDEN\" or \"OK\").\n    // Otherwise, just turn the number into a string.\n    var body = statusCodes[statusCode] || String(statusCode);\n\n    // Set the response status code.\n    res.statusCode = statusCode;\n\n    // Send the response.\n    return res.send(body);\n  };\n\n  // res.send()\n  res.send = res.send || function _sendShim (data, noLongerSupported) {\n    if (!_.isUndefined(noLongerSupported)) {\n      throw new Error('The 2-ary usage of `res.send()` is no longer supported in Express 4/Sails v1.  Please use `res.status(statusCode).send(body)` instead.');\n    }\n\n    // Don't allow users to respond/redirect more than once per request\n    // FUTURE: prbly move this check to our `res.writeHead()` impl\n    try {\n      onlyAllowOneResponse(res);\n    }\n    catch (e) {\n      if (req._sails && req._sails.log && req._sails.log.error) {\n        req._sails.log.error(e);\n        return;\n      }\n      console.error(e);\n      return;\n    }\n\n    // Ensure charset is set\n    res.charset = res.charset || 'utf-8';","sourceCodeStart":180,"sourceCodeEnd":216,"githubUrl":"https://github.com/balderdashy/sails/blob/7b76422cc27823df033572bdda5c4910a68b697f/lib/router/res.js#L180-L216","documentation":"Error \"The 2-ary usage of `res.send()` is no longer supported in Express 4/Sails v1.  Please use `res.status(statusCode).send(body)` instead.\" thrown in balderdashy/sails.","triggerScenarios":"Thrown at lib/router/res.js:198 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"7b76422cc27823df033572bdda5c4910a68b697f","analyzedAt":"2026-09-01T04:01:57.104Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}