{"record":{"id":"6ff4442e169fbd91","repo":"Seldaek/monolog","slug":"could-not-connect-to-s","errorCode":null,"errorMessage":"Could not connect to %s","messagePattern":"Could not connect to (.+?)","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"src/Monolog/Handler/CouchDBHandler.php","lineNumber":86,"sourceCode":"    {\n        $basicAuth = null;\n        if (null !== $this->options['username'] && null !== $this->options['password']) {\n            $basicAuth = sprintf('%s:%s@', $this->options['username'], $this->options['password']);\n        }\n\n        $url = 'http://'.$basicAuth.$this->options['host'].':'.$this->options['port'].'/'.$this->options['dbname'];\n        $context = stream_context_create([\n            'http' => [\n                'method'        => 'POST',\n                'content'       => $record->formatted,\n                'ignore_errors' => true,\n                'max_redirects' => 0,\n                'header'        => 'Content-type: application/json',\n            ],\n        ]);\n\n        if (false === @file_get_contents($url, false, $context)) {\n            throw new \\RuntimeException(sprintf('Could not connect to %s', $url));\n        }\n    }\n\n    /**\n     * @inheritDoc\n     */\n    protected function getDefaultFormatter(): FormatterInterface\n    {\n        return new JsonFormatter(JsonFormatter::BATCH_MODE_JSON, false);\n    }\n}\n","sourceCodeStart":68,"sourceCodeEnd":98,"githubUrl":"https://github.com/Seldaek/monolog/blob/57eb1028342134e701e77c617565d51b6e5a2a53/src/Monolog/Handler/CouchDBHandler.php#L68-L98","documentation":"Error \"Could not connect to %s\" thrown in Seldaek/monolog.","triggerScenarios":"Thrown at src/Monolog/Handler/CouchDBHandler.php:86 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":"57eb1028342134e701e77c617565d51b6e5a2a53","analyzedAt":"2026-08-17T02:36:30.259Z","schemaVersion":2},"datasetVersion":"2026-08-17T04:17:16.089Z"}