Skip to content
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

Merged
merged 3 commits into from
Nov 15, 2014

Conversation

blizzz
Copy link
Contributor

@blizzz blizzz commented Nov 14, 2014

as discussed. I replaced all occurences in lib/private/db.

@MorrisJobke @DeepDiver1975 @LukasReschke

@LukasReschke
Copy link
Member

Mhm. Any specific reason to throw an hint exception? - I'd either use the generic one or create a new one.

@@ -71,7 +72,7 @@ public function insertIfNotExist($table, $input) {
$entry .= 'Offending command was: ' . $query.'<br />';
\OC_Log::write('core', $entry, \OC_Log::FATAL);
error_log('DB error: ' . $entry);
Copy link
Member

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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ack

@blizzz
Copy link
Contributor Author

blizzz commented Nov 14, 2014

@LukasReschke because a HintExecption will end up with the same output (if not caught before).

@LukasReschke
Copy link
Member

@LukasReschke because a HintExecption will end up with the same output (if not caught before).

Yes - but do we really need to print information about database errors to the user? - This can lead to nasty bugs such as #11325

I'd prefer if we would just show the generic error page - getting more information is then always possible via the log.

@blizzz
Copy link
Contributor Author

blizzz commented Nov 14, 2014

@LukasReschke mh, not, we can keep it, but we pass just "Database error" and "ask your admin" and pass the original exception to the hint one. So DB information will not be leaked to users, but apps / core can react upon the original exception with full details.

@DeepDiver1975
Copy link
Member

I'd prefer if we would just show the generic error page - getting more information is then always possible via the log.

we have to be careful in changing the exception type to be thrown because of the potential to change the behavior regarding the status code.

@LukasReschke
Copy link
Member

Ok. Convinced then ;-)

@blizzz
Copy link
Contributor Author

blizzz commented Nov 14, 2014

→ removed information leak
→ removed header

@scrutinizer-notifier
Copy link

The inspection completed: 1 new issues

@LukasReschke
Copy link
Member

Sometimes I think this bot is just an invention of @DeepDiver1975 to make us developers suffer for untested code 😈 ;-)

@LukasReschke
Copy link
Member

@owncloud-bot Retest this please.

@ghost
Copy link

ghost commented Nov 15, 2014

🚀 Test PASSed. 🚀
Refer to this link for build results (access rights to CI server needed):
https://ci.owncloud.org//job/pull-request-analyser-ng-simple/2666/
🚀 Test PASSed. 🚀

@MorrisJobke MorrisJobke added this to the 2014-sprint-08-current milestone Nov 15, 2014
@LukasReschke
Copy link
Member

👍

1 similar comment
@MorrisJobke
Copy link
Contributor

👍

MorrisJobke added a commit that referenced this pull request Nov 15, 2014
eliminate OC_Template::printErrorPage in database classes, fixes #12182
@MorrisJobke MorrisJobke merged commit b9e86b0 into master Nov 15, 2014
@MorrisJobke MorrisJobke deleted the fix-12182 branch November 15, 2014 15:50
@lock lock bot locked as resolved and limited conversation to collaborators Aug 15, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants