Skip to content

Commit 6b20075

Browse files
Add setter for description
1 parent d06b1a0 commit 6b20075

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/State/ApiResource/Error.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,7 @@ public function __construct(
136136
?\Throwable $previous = null,
137137
private ?array $meta = null,
138138
private ?array $source = null,
139+
private ?string $description = null,
139140
) {
140141
parent::__construct($title, $status, $previous);
141142

@@ -186,7 +187,12 @@ public function getSource(): ?array
186187
#[ApiProperty(writable: false, initializable: false)]
187188
public function getDescription(): ?string
188189
{
189-
return $this->detail;
190+
return $this->description ?? $this->detail;
191+
}
192+
193+
public function setDescription(?string $description = null): void
194+
{
195+
$this->description = $description;
190196
}
191197

192198
public static function createFromException(\Exception|\Throwable $exception, int $status): self

0 commit comments

Comments
 (0)