Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Surface errors in generate_site_meta if they happen #59

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion includes/Services/SiteGenService.php
Expand Up @@ -117,7 +117,7 @@ public static function instantiate_site_meta( $site_info, $identifier, $skip_cac
// Handle the error case by returning a WP_Error.
return new \WP_Error(
'nfd_onboarding_error',
__( 'Error generating site meta: ', 'wp-module-onboarding' ) . $identifier,
__( 'Error generating site meta: ', 'wp-module-onboarding' ) . $identifier . ' ' . $response['error'],
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Sitegen class also returns an array sometimes for the same object $response['error'] and sometimes a String, Need to find a better way else we might still be not able to surface the errors.

Screenshot 2024-03-12 at 9 54 31 AM

array( 'status' => 400 )
);
}
Expand Down