Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
CiviCRM Core
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container Registry
Model registry
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Development
CiviCRM Core
Commits
eea8ec44
Commit
eea8ec44
authored
5 years ago
by
eileen
Browse files
Options
Downloads
Patches
Plain Diff
Remove a couple of instances of fatal errors in favour of throwing exceptions
#560
parent
b632d5ee
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
CRM/Core/BAO/File.php
+2
-2
2 additions, 2 deletions
CRM/Core/BAO/File.php
with
2 additions
and
2 deletions
CRM/Core/BAO/File.php
+
2
−
2
View file @
eea8ec44
...
...
@@ -210,7 +210,7 @@ class CRM_Core_BAO_File extends CRM_Core_DAO_File {
$fileDAO
=
new
CRM_Core_DAO_File
();
$fileDAO
->
id
=
$fileID
;
if
(
!
$fileDAO
->
find
(
TRUE
))
{
CRM_Core_Error
::
fatal
(
);
throw
new
CRM_Core_Exception
(
ts
(
'File not found'
)
);
}
// lets call a pre hook before the delete, so attachments hooks can get the info before things
...
...
@@ -226,7 +226,7 @@ class CRM_Core_BAO_File extends CRM_Core_DAO_File {
$entityFileDAO
->
entity_table
=
$tableName
;
if
(
!
$entityFileDAO
->
find
(
TRUE
))
{
CRM_Core_Error
::
fatal
(
sprintf
(
'No record found for given file ID - %d and entity ID - %d'
,
$fileID
,
$entityID
));
throw
new
CRM_Core_Exception
(
sprintf
(
'No record found for given file ID - %d and entity ID - %d'
,
$fileID
,
$entityID
));
}
$entityFileDAO
->
delete
();
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment