cs
This commit is contained in:
@@ -106,8 +106,7 @@ class FieldManager
|
||||
|
||||
try {
|
||||
$this->rebuild($scope);
|
||||
}
|
||||
catch (Error $e) {
|
||||
} catch (Error $e) {
|
||||
$fieldManagerTool->delete($scope, $name);
|
||||
|
||||
throw new Error($e->getMessage());
|
||||
|
||||
@@ -137,8 +137,7 @@ class AfterUpgrade implements Script
|
||||
if ($schemaManager->tablesExist('stream_subscription')) {
|
||||
try {
|
||||
$schemaManager->dropTable('stream_subscription');
|
||||
}
|
||||
catch (DbalException) {
|
||||
} catch (DbalException) {
|
||||
$schemaManager->renameTable('stream_subscription', 'stream_subscription_waste');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -108,8 +108,7 @@ class ConfigWriterFileManager
|
||||
{
|
||||
try {
|
||||
$data = $this->fileManager->getPhpContents($path);
|
||||
}
|
||||
catch (RuntimeException) {
|
||||
} catch (RuntimeException) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
+1
-2
@@ -73,8 +73,7 @@ class PrepareForFulltextIndex implements RebuildAction
|
||||
try {
|
||||
/** @var array{Type: string, Collation: string} $row */
|
||||
$row = $connection->fetchAssociative($sql);
|
||||
}
|
||||
catch (Exception) {
|
||||
} catch (Exception) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
@@ -519,8 +519,7 @@ class Permission
|
||||
|
||||
try {
|
||||
$this->chmod($path, $this->writablePermissions, $options['recursive']);
|
||||
}
|
||||
catch (Throwable) {}
|
||||
} catch (Throwable) {}
|
||||
|
||||
/** check is writable */
|
||||
$res = is_writable($path);
|
||||
@@ -532,8 +531,7 @@ class Permission
|
||||
$res &= $this->fileManager->putContents($path . '/' . $name, 'test');
|
||||
|
||||
$res &= $this->fileManager->removeFile($name, $path);
|
||||
}
|
||||
catch (Throwable) {
|
||||
} catch (Throwable) {
|
||||
$res = false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -235,8 +235,7 @@ class Unifier
|
||||
|
||||
try {
|
||||
return Json::decode($fileContent, !$this->useObjects);
|
||||
}
|
||||
catch (JsonException) {
|
||||
} catch (JsonException) {
|
||||
throw new JsonException("JSON syntax error in '$path'.");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -135,8 +135,7 @@ class ScheduledJob
|
||||
try {
|
||||
$r1From = new DateTime('-' . $this->checkingCronPeriod);
|
||||
$r1To = new DateTime('+' . $this->checkingCronPeriod);
|
||||
}
|
||||
catch (Exception $e) {
|
||||
} catch (Exception $e) {
|
||||
throw new RuntimeException();
|
||||
}
|
||||
|
||||
|
||||
@@ -633,8 +633,7 @@ class Util
|
||||
$data[8] = chr(ord($data[8]) & 0x3f | 0x80);
|
||||
|
||||
$hex = bin2hex($data);
|
||||
}
|
||||
catch (Exception) {
|
||||
} catch (Exception) {
|
||||
throw new RuntimeException("Could not generate UUID.");
|
||||
}
|
||||
|
||||
|
||||
@@ -97,8 +97,7 @@ class ExternalAccount extends Integration
|
||||
|
||||
try {
|
||||
return DateTime::fromString($raw);
|
||||
}
|
||||
catch (RuntimeException) {
|
||||
} catch (RuntimeException) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -332,8 +332,7 @@ class Image implements EntryPoint
|
||||
case 'image/webp':
|
||||
try {
|
||||
$sourceImage = imagecreatefromwebp($filePath);
|
||||
}
|
||||
catch (Throwable) {
|
||||
} catch (Throwable) {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
@@ -79,8 +79,7 @@ class Formula implements BeforeSave
|
||||
{
|
||||
try {
|
||||
$this->formulaManager->run($script, $entity, $variables);
|
||||
}
|
||||
catch (Exception $e) {
|
||||
} catch (Exception $e) {
|
||||
$this->log->critical('Before-save formula script failed. {message}', [
|
||||
'message' => $e->getMessage(),
|
||||
'exception' => $e,
|
||||
|
||||
+1
-2
@@ -87,8 +87,7 @@ class UserIsBusyType implements Func
|
||||
|
||||
try {
|
||||
$ranges = $this->service->fetchBusyRanges($userId, $params, $ignoreList);
|
||||
}
|
||||
catch (Exception $e) {
|
||||
} catch (Exception $e) {
|
||||
throw new RuntimeException($e->getMessage());
|
||||
}
|
||||
|
||||
|
||||
@@ -29,6 +29,7 @@
|
||||
|
||||
namespace Espo\Modules\Crm\Classes\Select\Call\PrimaryFilters;
|
||||
|
||||
use Espo\Core\Exceptions\BadRequest;
|
||||
use Espo\Core\Exceptions\Error;
|
||||
use Espo\Entities\User;
|
||||
|
||||
@@ -63,8 +64,7 @@ class Todays implements Filter
|
||||
$whereItem = $this->converterFactory
|
||||
->create(Call::ENTITY_TYPE, $this->user)
|
||||
->convert($queryBuilder, $item);
|
||||
}
|
||||
catch (Error $e) {
|
||||
} catch (BadRequest $e) {
|
||||
throw new LogicException($e->getMessage());
|
||||
}
|
||||
|
||||
|
||||
@@ -69,8 +69,7 @@ class Document extends Record
|
||||
$parentType,
|
||||
$relatedType
|
||||
);
|
||||
}
|
||||
catch (Error $e) {
|
||||
} catch (Error $e) {
|
||||
throw new BadRequest($e->getMessage());
|
||||
}
|
||||
|
||||
|
||||
@@ -68,8 +68,7 @@ class KnowledgeBaseArticle extends Record
|
||||
$parentType,
|
||||
$relatedType
|
||||
);
|
||||
}
|
||||
catch (Error $e) {
|
||||
} catch (Error $e) {
|
||||
throw new BadRequest($e->getMessage());
|
||||
}
|
||||
|
||||
|
||||
@@ -72,8 +72,7 @@ class ProcessMassEmail implements JobDataLess
|
||||
foreach ($pendingMassEmailList as $massEmail) {
|
||||
try {
|
||||
$this->queue->create($massEmail);
|
||||
}
|
||||
catch (Throwable $e) {
|
||||
} catch (Throwable $e) {
|
||||
$this->log->error(
|
||||
'Job ProcessMassEmail#createQueue ' . $massEmail->getId() . ': [' . $e->getCode() . '] ' .
|
||||
$e->getMessage()
|
||||
@@ -91,8 +90,7 @@ class ProcessMassEmail implements JobDataLess
|
||||
foreach ($massEmailList as $massEmail) {
|
||||
try {
|
||||
$this->processor->process($massEmail);
|
||||
}
|
||||
catch (Throwable $e) {
|
||||
} catch (Throwable $e) {
|
||||
$this->log->error(
|
||||
'Job ProcessMassEmail#processSending '. $massEmail->getId() . ': [' . $e->getCode() . '] ' .
|
||||
$e->getMessage()
|
||||
|
||||
@@ -154,8 +154,7 @@ class SubmitPopupReminders implements JobDataLess
|
||||
try {
|
||||
$this->webSocketSubmission
|
||||
->submit('popupNotifications.event', $userId, (object) ['list' => $list]);
|
||||
}
|
||||
catch (Throwable $e) {
|
||||
} catch (Throwable $e) {
|
||||
$this->log->error('Job SubmitPopupReminders: [' . $e->getCode() . '] ' .$e->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -211,8 +211,7 @@ class Service
|
||||
'usersLeftMiddle.callId:' => 'call.id',
|
||||
]
|
||||
);
|
||||
}
|
||||
catch (BadRequest|Forbidden $e) {
|
||||
} catch (BadRequest|Forbidden $e) {
|
||||
throw new RuntimeException($e->getMessage());
|
||||
}
|
||||
|
||||
@@ -288,8 +287,7 @@ class Service
|
||||
->where([
|
||||
'usersLeftMiddle.userId' => $entity->getId(),
|
||||
]);
|
||||
}
|
||||
catch (BadRequest|Forbidden $e) {
|
||||
} catch (BadRequest|Forbidden $e) {
|
||||
throw new RuntimeException($e->getMessage());
|
||||
}
|
||||
|
||||
@@ -352,8 +350,7 @@ class Service
|
||||
'createdAt',
|
||||
['false', 'hasAttachment'],
|
||||
]);
|
||||
}
|
||||
catch (BadRequest|Forbidden $e) {
|
||||
} catch (BadRequest|Forbidden $e) {
|
||||
throw new RuntimeException($e->getMessage());
|
||||
}
|
||||
|
||||
@@ -481,8 +478,7 @@ class Service
|
||||
'createdAt',
|
||||
'hasAttachment',
|
||||
]);
|
||||
}
|
||||
catch (BadRequest|Forbidden $e) {
|
||||
} catch (BadRequest|Forbidden $e) {
|
||||
throw new RuntimeException($e->getMessage());
|
||||
}
|
||||
|
||||
@@ -1079,8 +1075,7 @@ class Service
|
||||
'createdAt',
|
||||
['false', 'hasAttachment'],
|
||||
]);
|
||||
}
|
||||
catch (BadRequest|Forbidden $e) {
|
||||
} catch (BadRequest|Forbidden $e) {
|
||||
throw new RuntimeException($e->getMessage());
|
||||
}
|
||||
|
||||
|
||||
@@ -309,8 +309,7 @@ class Service
|
||||
],
|
||||
],
|
||||
]);
|
||||
}
|
||||
catch (BadRequest|Forbidden $e) {
|
||||
} catch (BadRequest|Forbidden $e) {
|
||||
throw new RuntimeException($e->getMessage());
|
||||
}
|
||||
|
||||
@@ -389,8 +388,7 @@ class Service
|
||||
],
|
||||
])
|
||||
->build();
|
||||
}
|
||||
catch (BadRequest|Forbidden $e) {
|
||||
} catch (BadRequest|Forbidden $e) {
|
||||
throw new RuntimeException($e->getMessage());
|
||||
}
|
||||
}
|
||||
@@ -455,8 +453,7 @@ class Service
|
||||
],
|
||||
])
|
||||
->build();
|
||||
}
|
||||
catch (BadRequest|Forbidden $e) {
|
||||
} catch (BadRequest|Forbidden $e) {
|
||||
throw new RuntimeException($e->getMessage());
|
||||
}
|
||||
}
|
||||
@@ -519,8 +516,7 @@ class Service
|
||||
],
|
||||
],
|
||||
]);
|
||||
}
|
||||
catch (BadRequest|Forbidden $e) {
|
||||
} catch (BadRequest|Forbidden $e) {
|
||||
throw new RuntimeException($e->getMessage());
|
||||
}
|
||||
|
||||
@@ -576,8 +572,7 @@ class Service
|
||||
$fetchParams->withScopeList($brScopeList),
|
||||
array_filter($eventList, fn (Item $item) => $item instanceof Event)
|
||||
);
|
||||
}
|
||||
catch (Exception $e) {
|
||||
} catch (Exception $e) {
|
||||
if ($e instanceof Forbidden) {
|
||||
continue;
|
||||
}
|
||||
@@ -739,8 +734,7 @@ class Service
|
||||
foreach ($userIdList as $userId) {
|
||||
try {
|
||||
$userItemList = $this->fetch($userId, $fetchParams);
|
||||
}
|
||||
catch (Exception $e) {
|
||||
} catch (Exception $e) {
|
||||
if ($e instanceof Forbidden) {
|
||||
continue;
|
||||
}
|
||||
@@ -858,8 +852,7 @@ class Service
|
||||
];
|
||||
|
||||
$rangeList[] = $busyItem;
|
||||
}
|
||||
catch (Exception) {}
|
||||
} catch (Exception) {}
|
||||
}
|
||||
|
||||
return array_map(
|
||||
@@ -958,8 +951,7 @@ class Service
|
||||
if ($diff->days > $this->config->get('busyRangesMaxRange', self::BUSY_RANGES_MAX_RANGE_DAYS)) {
|
||||
$toReturn = false;
|
||||
}
|
||||
}
|
||||
catch (Exception) {
|
||||
} catch (Exception) {
|
||||
throw new Error("BusyRanges: Bad date range.");
|
||||
}
|
||||
|
||||
@@ -1005,8 +997,7 @@ class Service
|
||||
$busyRangeList = $toReturn ?
|
||||
$this->fetchBusyRanges($userId, $fetchParams, $ignoreList) :
|
||||
[];
|
||||
}
|
||||
catch (Exception $e) {
|
||||
} catch (Exception $e) {
|
||||
if ($e instanceof Forbidden) {
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -233,8 +233,7 @@ class Service
|
||||
'id' => $contactIdList,
|
||||
])
|
||||
->build();
|
||||
}
|
||||
catch (BadRequest|Forbidden $e) {
|
||||
} catch (BadRequest|Forbidden $e) {
|
||||
throw new RuntimeException($e->getMessage());
|
||||
}
|
||||
|
||||
|
||||
@@ -446,8 +446,7 @@ class ConvertService
|
||||
|
||||
try {
|
||||
$opportunity = $service->create($values, CreateParams::create()->withSkipDuplicateCheck());
|
||||
}
|
||||
catch (BadRequest|Conflict $e) {
|
||||
} catch (BadRequest|Conflict $e) {
|
||||
throw new RuntimeException($e->getMessage());
|
||||
}
|
||||
|
||||
|
||||
@@ -80,8 +80,7 @@ class ByLeadSource
|
||||
->from(Opportunity::ENTITY_TYPE)
|
||||
->withStrictAccessControl()
|
||||
->buildQueryBuilder();
|
||||
}
|
||||
catch (BadRequest|Forbidden $e) {
|
||||
} catch (BadRequest|Forbidden $e) {
|
||||
throw new RuntimeException($e->getMessage());
|
||||
}
|
||||
|
||||
|
||||
@@ -147,8 +147,7 @@ class SalesByMonth
|
||||
|
||||
try {
|
||||
$dt = new DateTime($key . '-01');
|
||||
}
|
||||
catch (Exception $e) {
|
||||
} catch (Exception $e) {
|
||||
throw new LogicException();
|
||||
}
|
||||
|
||||
|
||||
@@ -163,8 +163,7 @@ class Service
|
||||
'id' => $contactIdList,
|
||||
])
|
||||
->build();
|
||||
}
|
||||
catch (BadRequest|Forbidden $e) {
|
||||
} catch (BadRequest|Forbidden $e) {
|
||||
throw new RuntimeException($e->getMessage());
|
||||
}
|
||||
|
||||
|
||||
@@ -73,8 +73,7 @@ class TransactionManager
|
||||
$result = $function();
|
||||
|
||||
$this->commit();
|
||||
}
|
||||
catch (Throwable $e) {
|
||||
} catch (Throwable $e) {
|
||||
$this->rollback();
|
||||
|
||||
/**
|
||||
|
||||
@@ -96,8 +96,7 @@ class ExternalAccount extends Record implements Di\HookManagerAware
|
||||
/** @var @bool */
|
||||
return $client->ping();
|
||||
}
|
||||
}
|
||||
catch (Exception) {}
|
||||
} catch (Exception) {}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -156,8 +156,7 @@ class User extends Record
|
||||
}
|
||||
|
||||
$this->getPasswordService()->sendAccessInfoForNewUser($user);
|
||||
}
|
||||
catch (Exception $e) {
|
||||
} catch (Exception $e) {
|
||||
$this->log->error("Could not send user access info. " . $e->getMessage());
|
||||
}
|
||||
|
||||
@@ -192,8 +191,7 @@ class User extends Record
|
||||
if ($user->isActive() && !empty($data->sendAccessInfo)) {
|
||||
$this->sendPassword($user, $newPassword);
|
||||
}
|
||||
}
|
||||
catch (Exception) {}
|
||||
} catch (Exception) {}
|
||||
}
|
||||
|
||||
return $user;
|
||||
|
||||
@@ -58,8 +58,7 @@ class PostDestroyAuthToken implements Action
|
||||
|
||||
try {
|
||||
$authentication->destroyAuthToken($token, $request, $response);
|
||||
}
|
||||
catch (NotFound) {
|
||||
} catch (NotFound) {
|
||||
return $response->writeBody(Json::encode(false));
|
||||
}
|
||||
|
||||
|
||||
@@ -60,8 +60,7 @@ class PostFromImageUrl implements Action
|
||||
|
||||
try {
|
||||
$fieldData = new FieldData($field, $parentType, $relatedType);
|
||||
}
|
||||
catch (Error $e) {
|
||||
} catch (Error $e) {
|
||||
throw new BadRequest($e->getMessage());
|
||||
}
|
||||
|
||||
|
||||
@@ -144,8 +144,7 @@ class UploadService
|
||||
if ($this->detailsObtainer->getFieldType($attachment) === FieldType::IMAGE) {
|
||||
try {
|
||||
$this->checker->checkTypeImage($attachment, $filePath);
|
||||
}
|
||||
catch (Forbidden $e) {
|
||||
} catch (Forbidden $e) {
|
||||
$this->entityManager->removeEntity($attachment);
|
||||
|
||||
throw new ForbiddenSilent($e->getMessage());
|
||||
|
||||
@@ -234,8 +234,7 @@ class AddressService
|
||||
->where($whereClause)
|
||||
->order('name')
|
||||
->limit(0, $limit);
|
||||
}
|
||||
catch (BadRequest|Forbidden $e) {
|
||||
} catch (BadRequest|Forbidden $e) {
|
||||
throw new RuntimeException($e->getMessage());
|
||||
}
|
||||
|
||||
|
||||
@@ -65,8 +65,7 @@ class PostAttachmentsCopy implements Action
|
||||
|
||||
try {
|
||||
$fieldData = new FieldData($field, $parentType, $relatedType);
|
||||
}
|
||||
catch (Error $e) {
|
||||
} catch (Error $e) {
|
||||
throw new BadRequest($e->getMessage());
|
||||
}
|
||||
|
||||
|
||||
@@ -68,8 +68,7 @@ class InboxService
|
||||
foreach ($idList as $id) {
|
||||
try {
|
||||
$this->moveToFolder($id, $folderId, $userId);
|
||||
}
|
||||
catch (Exception) {}
|
||||
} catch (Exception) {}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -110,8 +109,7 @@ class InboxService
|
||||
if ($folderId && str_starts_with($folderId, 'group:')) {
|
||||
try {
|
||||
$this->moveToGroupFolder($email, substr($folderId, 6), $user);
|
||||
}
|
||||
catch (Exception $e) {
|
||||
} catch (Exception $e) {
|
||||
$this->log->debug("Could not move email to group folder. " . $e->getMessage());
|
||||
|
||||
throw $e;
|
||||
@@ -504,8 +502,7 @@ class InboxService
|
||||
->getRDBRepository(Email::ENTITY_TYPE)
|
||||
->clone($itemSelectBuilder->build())
|
||||
->count();
|
||||
}
|
||||
catch (BadRequest|Forbidden $e) {
|
||||
} catch (BadRequest|Forbidden $e) {
|
||||
throw new RuntimeException($e->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -232,8 +232,7 @@ class SendService
|
||||
->withParams($params)
|
||||
->withMessage($message)
|
||||
->send($entity);
|
||||
}
|
||||
catch (Exception $e) {
|
||||
} catch (Exception $e) {
|
||||
$entity->setStatus(Email::STATUS_DRAFT);
|
||||
|
||||
$this->entityManager->saveEntity($entity, [SaveOption::SILENT => true]);
|
||||
@@ -309,8 +308,7 @@ class SendService
|
||||
|
||||
try {
|
||||
$this->groupAccountService->storeSentMessage($id, $message);
|
||||
}
|
||||
catch (Exception $e) {
|
||||
} catch (Exception $e) {
|
||||
$this->log->error(
|
||||
"Email sending: Could not store sent email (Group Email Account {$groupAccount->getId()}): " .
|
||||
$e->getMessage() . "."
|
||||
@@ -327,8 +325,7 @@ class SendService
|
||||
|
||||
try {
|
||||
$this->personalAccountService->storeSentMessage($id, $message);
|
||||
}
|
||||
catch (Exception $e) {
|
||||
} catch (Exception $e) {
|
||||
$this->log->error(
|
||||
"Email sending: Could not store sent email (Email Account {$personalAccount->getId()}): " .
|
||||
$e->getMessage() . "."
|
||||
@@ -474,8 +471,7 @@ class SendService
|
||||
$this->emailSender
|
||||
->withSmtpParams($params)
|
||||
->send($email);
|
||||
}
|
||||
catch (Exception $e) {
|
||||
} catch (Exception $e) {
|
||||
$this->log->warning("Email sending:" . $e->getMessage() . "; " . $e->getCode());
|
||||
|
||||
if ($e instanceof SendingError) {
|
||||
@@ -607,8 +603,7 @@ class SendService
|
||||
|
||||
try {
|
||||
$handler = $this->injectableFactory->create($handlerClassName);
|
||||
}
|
||||
catch (Throwable $e) {
|
||||
} catch (Throwable $e) {
|
||||
$this->log->error(
|
||||
"Email sending: Could not create Smtp Handler for $emailAddress. Error: " .
|
||||
$e->getMessage() . "."
|
||||
|
||||
@@ -182,8 +182,7 @@ class AssignmentProcessor
|
||||
|
||||
try {
|
||||
$this->emailSender->send($email);
|
||||
}
|
||||
catch (Exception $e) {
|
||||
} catch (Exception $e) {
|
||||
$this->log->error('EmailNotification: [' . $e->getCode() . '] ' . $e->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -369,8 +369,7 @@ class Processor
|
||||
$this->emailSender
|
||||
->withParams($senderParams)
|
||||
->send($email);
|
||||
}
|
||||
catch (Exception $e) {
|
||||
} catch (Exception $e) {
|
||||
$this->log->error('EmailNotification: [' . $e->getCode() . '] ' .$e->getMessage());
|
||||
}
|
||||
}
|
||||
@@ -583,8 +582,7 @@ class Processor
|
||||
$this->emailSender
|
||||
->withParams($senderParams)
|
||||
->send($email);
|
||||
}
|
||||
catch (Exception $e) {
|
||||
} catch (Exception $e) {
|
||||
$this->log->error('EmailNotification: [' . $e->getCode() . '] ' .$e->getMessage());
|
||||
}
|
||||
}
|
||||
@@ -739,8 +737,7 @@ class Processor
|
||||
$this->emailSender
|
||||
->withParams($senderParams)
|
||||
->send($email);
|
||||
}
|
||||
catch (Exception $e) {
|
||||
} catch (Exception $e) {
|
||||
$this->log->error('EmailNotification: [' . $e->getCode() . '] ' .$e->getMessage());
|
||||
}
|
||||
}
|
||||
@@ -880,8 +877,7 @@ class Processor
|
||||
$this->emailSender
|
||||
->withParams($senderParams)
|
||||
->send($email);
|
||||
}
|
||||
catch (Exception $e) {
|
||||
} catch (Exception $e) {
|
||||
$this->log->error('EmailNotification: [' . $e->getCode() . '] ' .$e->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -347,8 +347,7 @@ class Processor
|
||||
|
||||
try {
|
||||
$hasAccess = $this->aclManager->checkEntityRead($user, $relatedEntity);
|
||||
}
|
||||
catch (Exception) {
|
||||
} catch (Exception) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
@@ -542,8 +542,7 @@ class EntityManager
|
||||
foreach ($this->metadata->get(['entityDefs', $name, 'links'], []) as $link => $item) {
|
||||
try {
|
||||
$this->linkManager->delete(['entity' => $name, 'link' => $link]);
|
||||
}
|
||||
catch (Exception) {}
|
||||
} catch (Exception) {}
|
||||
}
|
||||
|
||||
$this->fileManager->removeFile("custom/Espo/Custom/Resources/metadata/entityDefs/$name.json");
|
||||
@@ -582,8 +581,7 @@ class EntityManager
|
||||
|
||||
$this->baseLanguage->delete('Global', 'scopeNames', $name);
|
||||
$this->baseLanguage->delete('Global', 'scopeNamesPlural', $name);
|
||||
}
|
||||
catch (Exception) {}
|
||||
} catch (Exception) {}
|
||||
|
||||
$this->metadata->save();
|
||||
$this->language->save();
|
||||
|
||||
@@ -374,8 +374,7 @@ class Renamer
|
||||
|
||||
try {
|
||||
$this->entityManager->getSqlExecutor()->execute($sql);
|
||||
}
|
||||
catch (Throwable $e) {
|
||||
} catch (Throwable $e) {
|
||||
$msg = $e->getMessage();
|
||||
|
||||
$this->log->error("Entity-rename: Rename relationship column failed: {$msg}.");
|
||||
@@ -608,8 +607,7 @@ class Renamer
|
||||
|
||||
try {
|
||||
$this->entityManager->getQueryExecutor()->execute($query);
|
||||
}
|
||||
catch (Throwable $e) {
|
||||
} catch (Throwable $e) {
|
||||
$msg = $e->getMessage();
|
||||
|
||||
$this->log->error("Entity-rename: Update values in link-parent field {$entityType}.{$field}: {$msg}.");
|
||||
|
||||
@@ -95,8 +95,7 @@ class Process implements Job
|
||||
$result = $export
|
||||
->setParams($entity->getParams())
|
||||
->run();
|
||||
}
|
||||
catch (Throwable $e) {
|
||||
} catch (Throwable $e) {
|
||||
$this->setFailed($entity);
|
||||
|
||||
throw new Error("Export job error: " . $e->getMessage());
|
||||
|
||||
@@ -61,8 +61,7 @@ class Service
|
||||
$this->parser->parse($expression);
|
||||
|
||||
$result = SyntaxCheckResult::createSuccess();
|
||||
}
|
||||
catch (SyntaxError $e) {
|
||||
} catch (SyntaxError $e) {
|
||||
return SyntaxCheckResult::createError($e);
|
||||
}
|
||||
|
||||
@@ -94,8 +93,7 @@ class Service
|
||||
|
||||
try {
|
||||
$this->manager->run($expression, $target, $variables);
|
||||
}
|
||||
catch (Error $e) {
|
||||
} catch (Error $e) {
|
||||
$output = $variables->__output ?? null;
|
||||
|
||||
return RunResult::createError($e, $output);
|
||||
|
||||
@@ -367,8 +367,7 @@ class Import
|
||||
'isDuplicate' => $rowResult['isDuplicate'] ?? false,
|
||||
]);
|
||||
}
|
||||
}
|
||||
catch (Exception $e) {
|
||||
} catch (Exception $e) {
|
||||
$this->log->error('Import: ' . $e->getMessage());
|
||||
|
||||
$import->set('status', ImportEntity::STATUS_FAILED);
|
||||
@@ -516,8 +515,7 @@ class Import
|
||||
|
||||
try {
|
||||
$this->processRowItem($entity, $attribute, $value, $valueMap);
|
||||
}
|
||||
catch (ValidationError $e) {
|
||||
} catch (ValidationError $e) {
|
||||
$failureList[] = $e->getFailure();
|
||||
}
|
||||
}
|
||||
@@ -593,8 +591,7 @@ class Import
|
||||
} else {
|
||||
$result['isUpdated'] = true;
|
||||
}
|
||||
}
|
||||
catch (Exception $e) {
|
||||
} catch (Exception $e) {
|
||||
$errorType = null;
|
||||
|
||||
if ((int) $e->getCode() === 23000 && $e instanceof PDOException) {
|
||||
|
||||
@@ -234,8 +234,7 @@ class Service
|
||||
|
||||
try {
|
||||
$createdAtDt = new DateTime($createdAt);
|
||||
}
|
||||
catch (Exception $e) {
|
||||
} catch (Exception $e) {
|
||||
throw new RuntimeException($e->getMessage());
|
||||
}
|
||||
|
||||
|
||||
@@ -103,8 +103,7 @@ class Service
|
||||
if (!$this->acl->checkScope($scope)) {
|
||||
throw new Forbidden("No access to scope $scope.");
|
||||
}
|
||||
}
|
||||
catch (NotImplemented) {}
|
||||
} catch (NotImplemented) {}
|
||||
|
||||
$data = null;
|
||||
|
||||
|
||||
@@ -174,8 +174,7 @@ class Processor
|
||||
|
||||
try {
|
||||
$service->processValidation($entity, $values);
|
||||
}
|
||||
catch (Exception) {
|
||||
} catch (Exception) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -185,8 +184,7 @@ class Processor
|
||||
|
||||
try {
|
||||
$this->linkCheck->processFields($entity);
|
||||
}
|
||||
catch (Forbidden) {
|
||||
} catch (Forbidden) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -119,8 +119,7 @@ class Service
|
||||
|
||||
try {
|
||||
$this->backchannelLogout->logout($rawToken);
|
||||
}
|
||||
catch (Invalid $e) {
|
||||
} catch (Invalid $e) {
|
||||
throw new Forbidden("OIDC logout: Invalid JWT. " . $e->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -127,8 +127,7 @@ class Service
|
||||
);
|
||||
|
||||
$result[$type] = $itemList;
|
||||
}
|
||||
catch (Throwable $e) {
|
||||
} catch (Throwable $e) {
|
||||
$this->log->error("Popup notifications: " . $e->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -88,8 +88,7 @@ class StarService
|
||||
'userId' => $user->getId(),
|
||||
'createdAt' => DateTime::getSystemNowString(),
|
||||
]);
|
||||
}
|
||||
catch (PDOException $e) {
|
||||
} catch (PDOException $e) {
|
||||
if ((int) $e->getCode() === 23000) {
|
||||
// Duplicate.
|
||||
return;
|
||||
|
||||
@@ -95,8 +95,7 @@ class AutoFollow implements Job
|
||||
|
||||
try {
|
||||
$hasAccess = $this->aclManager->checkEntityStream($user, $entity);
|
||||
}
|
||||
catch (AclNotImplemented $e) {
|
||||
} catch (AclNotImplemented $e) {
|
||||
$hasAccess = false;
|
||||
}
|
||||
|
||||
|
||||
@@ -142,8 +142,7 @@ class Helper
|
||||
$aclManager &&
|
||||
$aclManager->checkScope($user, $scope, Table::ACTION_READ) &&
|
||||
(!$forParent || $aclManager->checkScope($user, $scope, Table::ACTION_STREAM));
|
||||
}
|
||||
catch (AclNotImplemented) {
|
||||
} catch (AclNotImplemented) {
|
||||
$hasAccess = false;
|
||||
}
|
||||
|
||||
@@ -159,8 +158,7 @@ class Helper
|
||||
{
|
||||
try {
|
||||
return $this->userAclManagerProvider->get($user);
|
||||
}
|
||||
catch (NotAvailable) {
|
||||
} catch (NotAvailable) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -221,8 +221,7 @@ class Service
|
||||
|
||||
try {
|
||||
$hasAccess = $this->aclManager->checkEntityStream($user, $entity);
|
||||
}
|
||||
catch (AclNotImplemented) {
|
||||
} catch (AclNotImplemented) {
|
||||
$hasAccess = false;
|
||||
}
|
||||
|
||||
@@ -1103,8 +1102,7 @@ class Service
|
||||
{
|
||||
try {
|
||||
return $this->userAclManagerProvider->get($user);
|
||||
}
|
||||
catch (NotAvailable) {
|
||||
} catch (NotAvailable) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -204,8 +204,7 @@ class UserRecordService
|
||||
{
|
||||
try {
|
||||
return $this->userAclManagerProvider->get($user);
|
||||
}
|
||||
catch (Acl\Exceptions\NotAvailable) {
|
||||
} catch (Acl\Exceptions\NotAvailable) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -239,8 +239,7 @@ class RecoveryService
|
||||
|
||||
try {
|
||||
$this->send($request->getRequestId(), $emailAddress, $user);
|
||||
}
|
||||
catch (SendingError $e) {
|
||||
} catch (SendingError $e) {
|
||||
$message = "Email sending error. " . $e->getMessage();
|
||||
|
||||
$this->log->error($message);
|
||||
@@ -323,8 +322,7 @@ class RecoveryService
|
||||
|
||||
try {
|
||||
$this->send($entity->getRequestId(), $emailAddress, $user);
|
||||
}
|
||||
catch (SendingError $e) {
|
||||
} catch (SendingError $e) {
|
||||
$this->log->error("Email sending error. " . $e->getMessage());
|
||||
|
||||
throw new Error("Email sending error.");
|
||||
|
||||
@@ -284,8 +284,7 @@ class Service
|
||||
|
||||
try {
|
||||
$this->sender->sendPassword($user, $password);
|
||||
}
|
||||
catch (SendingError) {
|
||||
} catch (SendingError) {
|
||||
throw new Error("Email sending error.");
|
||||
}
|
||||
|
||||
|
||||
@@ -155,8 +155,7 @@ class Service
|
||||
$clientData = $this->twoFactorUserSetupFactory
|
||||
->create($auth2FAMethod)
|
||||
->getData($user);
|
||||
}
|
||||
catch (NotConfigured $e) {
|
||||
} catch (NotConfigured $e) {
|
||||
$this->log->error($e->getMessage());
|
||||
|
||||
throw Forbidden::createWithBody(
|
||||
|
||||
@@ -93,8 +93,7 @@ class GlobalCalendar implements Calendar
|
||||
|
||||
try {
|
||||
return new DateTimeZone($this->config->get('timeZone'));
|
||||
}
|
||||
catch (Exception $e) {
|
||||
} catch (Exception $e) {
|
||||
throw new RuntimeException($e->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -64,8 +64,7 @@ class SpecificCalendar implements Calendar
|
||||
) {
|
||||
try {
|
||||
$this->timezone = new DateTimeZone($config->get('timeZone'));
|
||||
}
|
||||
catch (Exception $e) {
|
||||
} catch (Exception $e) {
|
||||
throw new RuntimeException($e->getMessage());
|
||||
}
|
||||
|
||||
|
||||
@@ -64,8 +64,7 @@ class TeamCalendar implements Calendar
|
||||
) {
|
||||
try {
|
||||
$this->timezone = new DateTimeZone($config->get('timeZone'));
|
||||
}
|
||||
catch (Exception $e) {
|
||||
} catch (Exception $e) {
|
||||
throw new RuntimeException($e->getMessage());
|
||||
}
|
||||
|
||||
|
||||
@@ -63,8 +63,7 @@ class UserCalendar implements Calendar
|
||||
) {
|
||||
try {
|
||||
$this->timezone = new DateTimeZone($config->get('timeZone'));
|
||||
}
|
||||
catch (Exception $e) {
|
||||
} catch (Exception $e) {
|
||||
throw new RuntimeException($e->getMessage());
|
||||
}
|
||||
|
||||
|
||||
@@ -253,8 +253,7 @@ class Installer
|
||||
}
|
||||
|
||||
$this->language = $language;
|
||||
}
|
||||
catch (Throwable $e) {
|
||||
} catch (Throwable $e) {
|
||||
echo "Error: " . $e->getMessage();
|
||||
|
||||
$GLOBALS['log']->error($e->getMessage());
|
||||
@@ -328,8 +327,7 @@ class Installer
|
||||
|
||||
try {
|
||||
$this->databaseHelper->createPDO($params);
|
||||
}
|
||||
catch (Exception $e) {
|
||||
} catch (Exception $e) {
|
||||
if (!$createDatabase) {
|
||||
throw $e;
|
||||
}
|
||||
@@ -431,8 +429,7 @@ class Installer
|
||||
{
|
||||
try {
|
||||
$this->app->getContainer()->getByClass(DataManager::class)->rebuild();
|
||||
}
|
||||
catch (Exception) {
|
||||
} catch (Exception) {
|
||||
$this->auth();
|
||||
|
||||
$this->app->getContainer()->getByClass(DataManager::class)->rebuild();
|
||||
|
||||
@@ -95,8 +95,7 @@ if (
|
||||
|
||||
try {
|
||||
$installer->checkDatabaseConnection($databaseParams, true);
|
||||
}
|
||||
catch (\Exception $e) {
|
||||
} catch (\Exception $e) {
|
||||
$isConnected = false;
|
||||
$result['success'] = false;
|
||||
$result['errors']['dbConnect']['errorCode'] = $e->getCode();
|
||||
|
||||
@@ -511,8 +511,7 @@ class FieldValidationTest extends BaseTestCase
|
||||
],
|
||||
],
|
||||
], CreateParams::create());
|
||||
}
|
||||
catch (BadRequest) {
|
||||
} catch (BadRequest) {
|
||||
$thrown = true;
|
||||
}
|
||||
|
||||
|
||||
@@ -133,8 +133,7 @@ class AuditTest extends BaseTestCase
|
||||
$service = $this->getInjectableFactory()->create(RecordService::class);
|
||||
/** @noinspection PhpUnhandledExceptionInspection */
|
||||
$service->findUpdates(KnowledgeBaseArticle::ENTITY_TYPE, $article->getId(), $searchParams);
|
||||
}
|
||||
catch (Forbidden) {
|
||||
} catch (Forbidden) {
|
||||
$isThrown = true;
|
||||
}
|
||||
|
||||
@@ -149,8 +148,7 @@ class AuditTest extends BaseTestCase
|
||||
$service = $this->getInjectableFactory()->create(RecordService::class);
|
||||
/** @noinspection PhpUnhandledExceptionInspection */
|
||||
$service->findUpdates(KnowledgeBaseArticle::ENTITY_TYPE, $article->getId(), $searchParams);
|
||||
}
|
||||
catch (Forbidden) {
|
||||
} catch (Forbidden) {
|
||||
$isThrown = true;
|
||||
}
|
||||
|
||||
|
||||
@@ -280,8 +280,7 @@ class AclTest extends \tests\integration\Core\BaseTestCase
|
||||
|
||||
try {
|
||||
$processor->process('User', 'update', $request, $response);
|
||||
}
|
||||
catch (Exception $e) {};
|
||||
} catch (Exception $e) {};
|
||||
}
|
||||
|
||||
protected function prepareTestUser()
|
||||
|
||||
Reference in New Issue
Block a user