HTTP/2 301
server: nginx
date: Sat, 27 Dec 2025 09:26:46 GMT
content-type: text/html; charset=UTF-8
x-olaf: ⛄
vary: accept, content-type
x-redirect-by: WordPress
location: https://developer.wordpress.org/reference/classes/wp_fatal_error_handler/detect_error/
x-frame-options: SAMEORIGIN
alt-svc: h3=":443"; ma=86400
x-nc: MISS ord 2
HTTP/2 200
server: nginx
date: Sat, 27 Dec 2025 09:26:47 GMT
content-type: text/html; charset=UTF-8
vary: Accept-Encoding
x-olaf: ⛄
vary: accept, content-type
link:
; rel="https://api.w.org/"
link:
; rel="alternate"; title="JSON"; type="application/json"
link: ; rel=shortlink
x-frame-options: SAMEORIGIN
content-encoding: gzip
alt-svc: h3=":443"; ma=86400
x-nc: MISS ord 2
WP_Fatal_Error_Handler::detect_error() – Method | Developer.WordPress.org
WordPress Developer Resources
WP_Fatal_Error_Handler::detect_error()
WP_Fatal_Error_Handler::detect_error(): array|null
Detects the error causing the crash if it should be handled.
array|null Error information returned by error_get_last(), or null if none was recorded or the error should not be handled.
protected function detect_error() {
$error = error_get_last();
// No error, just skip the error handling code.
if ( null === $error ) {
return null;
}
// Bail if this error should not be handled.
if ( ! $this->should_handle_error( $error ) ) {
return null;
}
return $error;
}
View all references View on Trac View on GitHub
Version Description 5.2.0 Introduced.
User Contributed Notes
You must log in before being able to contribute a note or feedback.