Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Nextcloud
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Monitor
Service Desk
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
TeDomum
Nextcloud
Commits
ad2033ef
Unverified
Commit
ad2033ef
authored
4 years ago
by
Christoph Wurst
Committed by
GitHub
4 years ago
Browse files
Options
Downloads
Plain Diff
Merge pull request #25444 from nextcloud/bug/25415/move-generic-errors-to-end
Check for generic errors at last.
parents
392dc8b8
fe378200
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
lib/private/DB/Exceptions/DbalException.php
+13
-13
13 additions, 13 deletions
lib/private/DB/Exceptions/DbalException.php
with
13 additions
and
13 deletions
lib/private/DB/Exceptions/DbalException.php
+
13
−
13
View file @
ad2033ef
...
...
@@ -75,19 +75,6 @@ class DbalException extends Exception {
}
public
function
getReason
():
?int
{
/**
* Generic errors
*/
if
(
$this
->
original
instanceof
ConnectionException
)
{
return
parent
::
REASON_CONNECTION_LOST
;
}
if
(
$this
->
original
instanceof
DriverException
)
{
return
parent
::
REASON_DRIVER
;
}
if
(
$this
->
original
instanceof
InvalidArgumentException
)
{
return
parent
::
REASON_INVALID_ARGUMENT
;
}
/**
* Constraint errors
*/
...
...
@@ -131,6 +118,19 @@ class DbalException extends Exception {
return
parent
::
REASON_SERVER
;
}
/**
* Generic errors
*/
if
(
$this
->
original
instanceof
ConnectionException
)
{
return
parent
::
REASON_CONNECTION_LOST
;
}
if
(
$this
->
original
instanceof
InvalidArgumentException
)
{
return
parent
::
REASON_INVALID_ARGUMENT
;
}
if
(
$this
->
original
instanceof
DriverException
)
{
return
parent
::
REASON_DRIVER
;
}
return
null
;
}
}
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