Home / File/ error-status.js — fastify Source File

error-status.js — fastify Source File

Architecture documentation for error-status.js, a javascript file in the fastify codebase.

Entity Profile

Relationship Graph

Source Code

'use strict'

const {
  kReplyHasStatusCode
} = require('./symbols')

function setErrorStatusCode (reply, err) {
  if (!reply[kReplyHasStatusCode] || reply.statusCode === 200) {
    const statusCode = err && (err.statusCode || err.status)
    reply.code(statusCode >= 400 ? statusCode : 500)
  }
}

module.exports = { setErrorStatusCode }

Domain

Subdomains

Frequently Asked Questions

What does error-status.js do?
error-status.js is a source file in the fastify codebase, written in javascript. It belongs to the CoreKernel domain, LifecycleManager subdomain.
What functions are defined in error-status.js?
error-status.js defines 1 function(s): setErrorStatusCode.
Where is error-status.js in the architecture?
error-status.js is located at lib/error-status.js (domain: CoreKernel, subdomain: LifecycleManager, directory: lib).

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free