previous !== null) { $message .= ": {$this->previous->getMessage()}"; } return $message; } public function getCode() { return $this->previous?->getCode() ?? 500; } public function getFile(): string { return $this->previous?->getFile() ?? ''; } public function getLine(): int { return $this->previous?->getLine() ?? 0; } public function getTrace(): array { return $this->previous?->getTrace() ?? []; } public function getTraceAsString(): string { return $this->previous?->getTraceAsString() ?? ''; } public function getPrevious(): ?Throwable { return $this->previous; } public function __toString() { return $this->getMessage(); } }