{"record":{"id":"d39047c8b67b3439","repo":"Leantime/leantime","slug":"calendar-could-not-be-retrieved","errorCode":null,"errorMessage":"Calendar could not be retrieved","messagePattern":"Calendar could not be retrieved","errorType":"exception","errorClass":"\\Exception","httpStatus":null,"severity":"error","filePath":"app/Domain/Calendar/Services/Calendar.php","lineNumber":401,"sourceCode":"     * @return IcalCalendar The iCal calendar generated from the calendar events.\n     *\n     * @throws MissingParameterException If either user hash or calendar hash is empty.\n     *\n     * Not @api: served by the PUBLIC, hash-authenticated /calendar/ical route (no session). The\n     * userHash+calHash secrets ARE the credential; exposing it over JSON-RPC would let a caller\n     * brute-force feeds. The Ical controller calls it internally.\n     */\n    public function getIcalByHash(string $userHash, string $calHash): IcalCalendar\n    {\n\n        if (empty($userHash) || empty($calHash)) {\n            throw new MissingParameterException('userHash and calendar hash are required');\n        }\n\n        $calendarEvents = $this->calendarRepo->getCalendarBySecretHash($userHash, $calHash);\n\n        if (! $calendarEvents) {\n            throw new \\Exception('Calendar could not be retrieved');\n        }\n\n        $eventObjects = [];\n        // Create array of event objects for ical generator\n        foreach ($calendarEvents as $event) {\n\n            try {\n\n                $description = str_replace(\"\\r\\n\", '\\\\n', strip_tags($event['description']));\n\n                $currentEvent = IcalEvent::create()\n                    ->image(BASE_URL.'/dist/images/favicon.png', 'image/png', Display::badge())\n                    ->startsAt(dtHelper()->parseDbDateTime($event['dateFrom'])->setToUserTimezone())\n                    ->endsAt(dtHelper()->parseDbDateTime($event['dateTo'])->setToUserTimezone())\n                    ->name($event['title'])\n                    ->description($description)\n                    ->uniqueIdentifier($event['id'])\n                    ->url($event['url'] ?? '');","sourceCodeStart":383,"sourceCodeEnd":419,"githubUrl":"https://github.com/Leantime/leantime/blob/9a9f49f1008f4782b30f6723c54228f4f992e636/app/Domain/Calendar/Services/Calendar.php#L383-L419","documentation":"Error \"Calendar could not be retrieved\" thrown in Leantime/leantime.","triggerScenarios":"Thrown at app/Domain/Calendar/Services/Calendar.php:401 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":"9a9f49f1008f4782b30f6723c54228f4f992e636","analyzedAt":"2026-08-21T02:37:38.966Z","schemaVersion":2},"datasetVersion":"2026-08-21T03:17:12.404Z"}