[TYPO3-core] RFC: another enhancement to the DB connect method and error display in the FE

Dmitry Dulepov [typo3] dmitry at typo3.org
Tue Sep 25 10:01:16 CEST 2007


Hi!

Martin Kutschker wrote:
> Nobody wants a nice error message in the FE? Everybody's happy wih 
> logging and guessing? I think that the average user would welcome an 
> easier way to determine which went wrong with his DB connection.

I overlooked this patch earlier, sorry :(

t3lib_db is a class. So I think we should have a method there for returning errors. Something like getLastErrorCode() and getLastError(). Having default parameters to functions for returning values in not very OO approach. What do you think?

So code will look like:

if (!$TYPO3_db->p_connect($TYPO3_db_host, $TYPO3_db_username, $TYPO3_db_password)) {
	$lastError = $TYPO3_db->getLastError();
	// TODO Show nice error
}

It also reminds me about idea of standalone system function (in t3lib_div?) that can format and output such critical errors generally in typo3 because right now everyone does it on its own: core shows its errors in one style, realurl in another, templavoila has yet its own box. We should have a template file that can be used for that (and changable by admin).

-- 
Dmitry Dulepov
TYPO3 freelancer / TYPO3 core team member
Web: http://typo3bloke.net/
Skype: callto:liels_bugs


More information about the TYPO3-team-core mailing list