-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
eliminate OC_Template::printErrorPage in database classes, fixes #12182 #12186
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -64,7 +64,7 @@ public function execute($input=array()) { | |
} else { | ||
$result = $this->statement->execute(); | ||
} | ||
|
||
if ($result === false) { | ||
return false; | ||
} | ||
|
@@ -161,11 +161,10 @@ private function tryFixSubstringLastArgumentDataForMSSQL($input) { | |
// send http status 503 | ||
header('HTTP/1.1 503 Service Temporarily Unavailable'); | ||
header('Status: 503 Service Temporarily Unavailable'); | ||
OC_Template::printErrorPage('Failed to connect to database'); | ||
die ($entry); | ||
throw new \OC\HintException($entry); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm not too sure about this one - HintException will translate to http status code 500 - not 503. We should add an httpstatus code to our exception classes - defaulting to 500 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. no, generic \Exception will end up in 500, HintException in 503, see https://github.com/owncloud/core/blob/master/index.php#L37. Actually, we should get rid of the header() here as well in that case. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
I see - thx - it's not really obvious that HintException will result in 503 - but this is a different discussion 😉 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
yes |
||
} | ||
} | ||
|
||
/** | ||
* provide an alias for fetch | ||
* | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we can also kill error_log() - would be written to the log twice then
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ack