forked from CodeWithKyrian/chromadb-php
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathValidationException.php
More file actions
43 lines (35 loc) · 948 Bytes
/
ValidationException.php
File metadata and controls
43 lines (35 loc) · 948 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
<?php
declare(strict_types=1);
namespace Codewithkyrian\ChromaDB\Generated\Exceptions;
class ValidationException extends \Exception
{
public function __construct(
public readonly array $loc,
string $message,
public readonly string $type,
int $code = 422,
\Throwable|null $previous = null)
{
parent::__construct($message, $code, $previous);
}
public static function make(array $data): self
{
return new self(
loc: $data['loc'],
message: $data['msg'],
type: $data['type'],
);
}
public function __toString(): string
{
return "ValidationException: {$this->message}";
}
public function toArray(): array
{
return [
'loc' => $this->loc,
'message' => $this->message,
'type' => $this->type,
];
}
}