public function buildMessage(Request $request, Response $response, Throwable $err = null): string
    {
        $base = 'Error occurred while dispatching request';
        if ($err === null) {
            return $base;
        }

        return sprintf('%s:%s%s', $base, PHP_EOL, $err);
    }
public function buildMessage(Request $request, Response $response, Throwable $err = null): string
    {
        $base = 'Error occurred while dispatching request';
        if ($err === null) {
            return $base;
        }

        return sprintf('%s:%s%s', $base, PHP_EOL, $err);
    }
public function buildMessage ( Request $ request , Response $ response , Throwable $ err = null ) : string { $ base = 'Error occurred while dispatching request' ; if ( $ err === null ) { return $ base ; } return sprintf ( '%s:%s%s' , $ base , PHP_EOL , $ err ) ; }
Builds a message to be logged based on the error handler params

@param Request $request
@param Response $response
@param \Throwable|null $err
@return string
Builds a message to be logged based on the error handler params