Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Stud.IP
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Jan-Hendrik Willms
Stud.IP
Commits
f3caade7
Commit
f3caade7
authored
Oct 31, 2022
by
Jan-Hendrik Willms
Committed by
David Siegfried
Oct 31, 2022
Browse files
Options
Downloads
Patches
Plain Diff
show exception on database connection error in development mode, fixes #1716
Closes #1716 Merge request
studip/studip!1121
parent
cda17d35
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
lib/bootstrap.php
+7
-3
7 additions, 3 deletions
lib/bootstrap.php
with
7 additions
and
3 deletions
lib/bootstrap.php
+
7
−
3
View file @
f3caade7
...
@@ -122,10 +122,14 @@ try {
...
@@ -122,10 +122,14 @@ try {
$GLOBALS
[
'DB_STUDIP_USER'
],
$GLOBALS
[
'DB_STUDIP_USER'
],
$GLOBALS
[
'DB_STUDIP_PASSWORD'
]);
$GLOBALS
[
'DB_STUDIP_PASSWORD'
]);
}
catch
(
PDOException
$exception
)
{
}
catch
(
PDOException
$exception
)
{
if
(
Studip\ENV
===
'development'
)
{
throw
$exception
;
}
else
{
header
(
'HTTP/1.1 500 Internal Server Error'
);
header
(
'HTTP/1.1 500 Internal Server Error'
);
die
(
sprintf
(
'database connection %s failed'
,
'mysql:host='
.
$GLOBALS
[
'DB_STUDIP_HOST'
]
.
die
(
sprintf
(
'database connection %s failed'
,
'mysql:host='
.
$GLOBALS
[
'DB_STUDIP_HOST'
]
.
';dbname='
.
$GLOBALS
[
'DB_STUDIP_DATABASE'
]));
';dbname='
.
$GLOBALS
[
'DB_STUDIP_DATABASE'
]));
}
}
}
// set slave connection
// set slave connection
if
(
isset
(
$GLOBALS
[
'DB_STUDIP_SLAVE_HOST'
]))
{
if
(
isset
(
$GLOBALS
[
'DB_STUDIP_SLAVE_HOST'
]))
{
try
{
try
{
...
...
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
sign in
to comment