Feature #17794
closed
add an error code to pageNotFoundAndExit
Added by Martin Kutschker about 17 years ago.
Updated about 6 years ago.
Description
A custom error handler has not enough infos to react corretly upon different error reasons. The only way is to parse the reason text which may change from one TYPO3 version to the next. Therefor it is necessary that the various $TSFE functions pass an error code to pageNotFoundAndExit() as parameter.
eg
100 = The requested page does not exist!
101 = The requested page does not exist (type)! *
200 = Page is not available in the requested language.
201 = Page is not available in the requested language (strict).
202 = Page is not available in default language.
300 = Request parameters could not be validated (&cHash comparison failed)
301 = Request parameters could not be validated (&cHash empty)
etc
(issue imported from #M6719)
Can't we extract code with regular expression? Something like:
$code = preg_replace('/^\S+\s+(\d+)\s/', '\1', $header);
(untested)
We could, but before that works the error message must contain them. And we should consider localization before we add numbers to messages.
- Description updated (diff)
- Category set to Frontend
- Status changed from New to Accepted
- Target version changed from 0 to 7.0
- PHP Version changed from 4.3 to 5.5
I agree that should be possible.
If header is omitted, the Regex by dimitry should try to extract the appropriate status code
- Target version changed from 7.0 to 7.1 (Cleanup)
- Target version changed from 7.1 (Cleanup) to 7.4 (Backend)
- Target version changed from 7.4 (Backend) to 7.5
- Target version changed from 7.5 to 7 LTS
- Target version changed from 7 LTS to 8 LTS
- Target version changed from 8 LTS to 9.0
- Target version changed from 9.0 to 9.2
- Target version changed from 9.2 to 9.3
- Target version changed from 9.3 to 9.4
- Status changed from Accepted to Under Review
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
- Status changed from Resolved to Closed
Also available in: Atom
PDF