mass convert currency catch bad request
This commit is contained in:
@@ -48,6 +48,7 @@ use Espo\Core\Utils\Metadata;
|
||||
use Espo\Entities\User;
|
||||
use Espo\Tools\Currency\Conversion\EntityConverterFactory;
|
||||
use RuntimeException;
|
||||
use Throwable;
|
||||
|
||||
/**
|
||||
* @noinspection PhpUnused
|
||||
@@ -123,7 +124,7 @@ class MassConvertCurrency implements MassAction
|
||||
|
||||
try {
|
||||
$converter->convert($entity, $targetCurrency, $rates);
|
||||
} catch (Forbidden $e) {
|
||||
} catch (Forbidden|BadRequest $e) {
|
||||
$this->log->info("Could not convert currency for {id}.", [
|
||||
'id' => $entity->getId(),
|
||||
'exception' => $e,
|
||||
|
||||
@@ -30,6 +30,7 @@
|
||||
namespace Espo\Tools\Currency\Conversion;
|
||||
|
||||
use Espo\Core\Currency\Rates;
|
||||
use Espo\Core\Exceptions\BadRequest;
|
||||
use Espo\Core\Exceptions\Forbidden;
|
||||
use Espo\ORM\Entity;
|
||||
|
||||
@@ -43,6 +44,7 @@ interface EntityConverter
|
||||
/**
|
||||
* @param TEntity $entity
|
||||
* @throws Forbidden
|
||||
* @throws BadRequest
|
||||
*/
|
||||
public function convert(Entity $entity, string $targetCurrency, Rates $rates): void;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user