Phly\Conduit\FinalHandler::getStatusCode PHP Method

getStatusCode() private method

If the error is an exception with a code between 400 and 599, returns the exception code. Otherwise, retrieves the code from the response; if not present, or less than 400 or greater than 599, returns 500; otherwise, returns it.
private getStatusCode ( mixed $error, Response $response ) : integer
$error mixed
$response Phly\Conduit\Http\Response
return integer
    private function getStatusCode($error, Http\Response $response)
    {
        if ($error instanceof Exception && ($error->getCode() >= 400 && $error->getCode() < 600)) {
            return $error->getCode();
        }
        $status = $response->getStatusCode();
        if (!$status || $status < 400 || $status >= 600) {
            $status = 500;
        }
        return $status;
    }