{"record":{"id":"8de7b1d4e9b759d1","repo":"krayin/laravel-crm","slug":"admin-app-leads-file-recursive-call","errorCode":"admin::app.leads.file.recursive-call","errorMessage":"Recursive call detected.","messagePattern":"Recursive call detected\\.","errorType":"exception","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"packages/Webkul/Lead/src/Services/MagicAIService.php","lineNumber":31,"sourceCode":"    const OPEN_ROUTER_URL = 'https://openrouter.ai/api/v1/chat/completions';\n\n    /**\n     * Maximum token limit for AI prompt.\n     */\n    const MAX_TOKENS = 100000;\n\n    /**\n     * Flag to prevent re-entrant calls.\n     */\n    private static $isExtracting = false;\n\n    /**\n     * Extract data from base64-encoded file.\n     */\n    public static function extractDataFromFile($base64File)\n    {\n        if (self::$isExtracting) {\n            throw new Exception(trans('admin::app.leads.file.recursive-call'));\n        }\n\n        self::$isExtracting = true;\n\n        try {\n            $text = self::extractTextFromBase64File($base64File);\n\n            if (empty($text)) {\n                throw new Exception(trans('admin::app.leads.file.failed-extract'));\n            }\n\n            return self::processPromptWithAI($text);\n        } catch (Exception $e) {\n            return ['error' => $e->getMessage()];\n        } finally {\n            self::$isExtracting = false;\n        }\n    }","sourceCodeStart":13,"sourceCodeEnd":49,"githubUrl":"https://github.com/krayin/laravel-crm/blob/13d6988cda8d69ece45ee1890effc90a7f21cdc1/packages/Webkul/Lead/src/Services/MagicAIService.php#L13-L49","documentation":"Error \"Recursive call detected.\" thrown in krayin/laravel-crm.","triggerScenarios":"Thrown at packages/Webkul/Lead/src/Services/MagicAIService.php:31 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":"13d6988cda8d69ece45ee1890effc90a7f21cdc1","analyzedAt":"2026-08-17T00:58:29.000Z","schemaVersion":2},"datasetVersion":"2026-08-17T04:17:16.089Z"}