Skip to content

Commit

Permalink
Error Handler: Add temporary logging to troubleshoot fatal (#1089)
Browse files Browse the repository at this point in the history
`Uncaught Error: Call to undefined function WordPressdotorg\MU_Plugins\Global_Fonts\get_font_stylesheet_url() in wp-content/themes/wporg-parent-2021/functions.php:46`

Related: 5ce4542
  • Loading branch information
iandunn authored Oct 16, 2023
1 parent 1e00312 commit 2f28f25
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions public_html/wp-content/mu-plugins/0-error-handling.php
Original file line number Diff line number Diff line change
Expand Up @@ -355,6 +355,26 @@ function send_error_to_slack( $err_no, $err_msg, $file, $line, $occurrences = 0
),
);

// temporary to troubleshoot URL routing error.
// maybe the `$url` above has some clues about the request that are stripped out by redact/esc functions.
// see https://wordpress.slack.com/archives/GDDSW0WNS/p1697474288356909.
$fields = array(
array(
'title' => 'tmp raw HTTP_HOST / SERVER_NAME',
'value' => sprintf(
'host: %s, name: %s, redir: %s, qs: %s, uri: %s, sapi: %s, ip: %s',
$_SERVER['HTTP_HOST'],
$_SERVER['SERVER_NAME'],
$_SERVER['REDIRECT_URL'],
$_SERVER['QUERY_STRING'],
$_SERVER['REQUEST_URI'],
php_sapi_name(),
$_SERVER['REMOTE_ADDR']
),
'short' => false,
),
);

if ( ! str_contains( $err_msg, $file ) ) {
$fields[] = array(
'title' => 'File',
Expand Down

0 comments on commit 2f28f25

Please sign in to comment.