{"record":{"id":"73c45415af7e7674","repo":"firefly-iii/firefly-iii","slug":"e-getmessage-73c454","errorCode":null,"errorMessage":"$e->getMessage()","messagePattern":"\\$e->getMessage\\(\\)","errorType":"exception","errorClass":"FireflyException","httpStatus":500,"severity":"error","filePath":"app/Http/Controllers/Report/DoubleController.php","lineNumber":109,"sourceCode":"                ];\n                ++$result[$key]['transactions'];\n                $result[$key]['sum']       = bcadd((string) $journal['amount'], $result[$key]['sum']);\n                $result[$key]['avg']       = bcdiv($result[$key]['sum'], (string) $result[$key]['transactions']);\n                $result[$key]['avg_float'] = (float) $result[$key]['avg'];\n            }\n        }\n        // sort by amount_float\n        // sort temp array by amount.\n        $amounts  = array_column($result, 'avg_float');\n        array_multisort($amounts, SORT_ASC, $result);\n\n        try {\n            $result = view('reports.double.partials.avg-expenses', ['result' => $result])->render();\n        } catch (Throwable $e) {\n            Log::error(sprintf('Could not render reports.partials.budget-period: %s', $e->getMessage()));\n            $result = sprintf('Could not render view: %s', $e->getMessage());\n\n            throw new FireflyException($e->getMessage(), 0, $e);\n        }\n\n        return $result;\n    }\n\n    /**\n     * @return string\n     *\n     * @throws FireflyException\n     */\n    public function avgIncome(Collection $accounts, Collection $doubles, Carbon $start, Carbon $end)\n    {\n        $expanded = $this->accountRepository->expandWithDoubles($doubles);\n        $accounts = $accounts->merge($expanded);\n        $spent    = $this->opsRepository->listIncome($start, $end, $accounts);\n        $result   = [];\n        foreach ($spent as $currency) {\n            foreach ($currency['transaction_journals'] as $journal) {","sourceCodeStart":91,"sourceCodeEnd":127,"githubUrl":"https://github.com/firefly-iii/firefly-iii/blob/fd8791d08d4d9e6467519a78048cd038e26b8878/app/Http/Controllers/Report/DoubleController.php#L91-L127","documentation":"Error \"$e->getMessage()\" thrown in firefly-iii/firefly-iii.","triggerScenarios":"Thrown at app/Http/Controllers/Report/DoubleController.php:109 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":"fd8791d08d4d9e6467519a78048cd038e26b8878","analyzedAt":"2026-08-17T02:14:53.848Z","schemaVersion":2},"datasetVersion":"2026-08-17T04:17:16.089Z"}