TYPO3 v9 has reached its end-of-life September 30th, 2021 and is not maintained by the community anymore. Looking for a stable version? Use the version switch on the top left.
You can order Extended Long Term Support (ELTS) here: TYPO3 ELTS.
Extbase offers an out of the box handling for errors. Errors might occur during mapping of incoming action arguments. E.g. an argument can not be mapped or validation did not pass.
How it works¶
Extbase will try to map all arguments within
ActionController. During this process arguments will also be validated.
If an error occurred, the class will call the
$this->errorMethodNameinstead of determined
The default is to call
Clear cache in case
persistence.enableAutomaticCacheClearingis activated and current scope is frontend.
Add an error Flash Message by calling
addErrorFlashMessage(). Which in turn will call
getErrorFlashMessage()to retrieve the message to show.
Forward back to referring request. If no referrer exists, a plain text message will be displayed, fetched from
Each of the above steps can be adjusted by implementing custom methods or
replacing values within properties. All of the above is
protected and therefore
can be replaced.
Replacing the default value
errorAction will result in a different method to
be called in case of an error.
Replacing the default implementation can be used to define custom error handling. E.g. the requested format could be checked and a prepared JSON result could be returned.
Can be replaced in order to return
false to prevent generation of a flash
message. Can also return any other custom string which will be placed inside the
generated flash message.
Can be replaced in order to display some other error message if no referrer exists.