Throw Read

This commit is contained in:
Juan Pablo Vial
2025-04-21 19:40:10 -04:00
parent 993e4ff3b8
commit f7af93b815
2 changed files with 34 additions and 4 deletions

View File

@ -16,9 +16,18 @@ class Unidad
protected Precio $precioService
) {}
/**
* @param int $unidad_id
* @return Model\Venta\Unidad
* @throws Read
*/
public function getById(int $unidad_id): Model\Venta\Unidad
{
return $this->process($this->unidadRepository->fetchById($unidad_id));
try {
return $this->process($this->unidadRepository->fetchById($unidad_id));
} catch (EmptyResult $exception) {
throw new Read(__CLASS__, $exception);
}
}
public function getByVenta(int $venta_id): array
{