misc: DTO 에러에서 name을 포함하여 알림

This commit is contained in:
2022-07-09 12:13:15 +09:00
parent 368f31d1fa
commit c2e956a639
8 changed files with 20 additions and 20 deletions
+3 -3
View File
@@ -27,12 +27,12 @@ class Convert
return $this;
}
public function convertFrom(string|array|int|float|bool|null $raw): mixed
public function convertFrom(string|array|int|float|bool|null $raw, string $name): mixed
{
if($this->converter === null){
throw new \Exception('converter is not set');
throw new \Exception("converter[{$name}] is not set");
}
return $this->converter->convertFrom($raw);
return $this->converter->convertFrom($raw, $name);
}
public function convertTo(mixed $target): string|array|int|float|bool|null {