Skip to content

Commit f5e1253

Browse files
authored
fix: add error message for WordPress 500 errors (#2144)
* fix: add proper error message for failing WordPress instance * add changeset * fix: catch all 5xx errors
1 parent 2e35b4f commit f5e1253

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

.changeset/few-bats-remember.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@faustwp/cli': patch
3+
---
4+
5+
Previously, WordPress connection failures lacked clear feedback. This update adds a proper error message when a 500 error occurs, improving debugging and usability.

packages/faustwp-cli/src/healthCheck/validateNextWordPressUrl.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,11 @@ export async function validateNextWordPressUrl(): Promise<void> {
2828
warnLog(
2929
'Route not found: Please update your FaustWP plugin to the latest version.',
3030
);
31+
} else if (response.status >= 500 && response.status < 600) {
32+
// Handle WordPress server error
33+
errorLog(
34+
'Could not connect to the WordPress server. Please check your WordPress URL or server status, as your site may not function correctly.',
35+
);
3136
} else {
3237
errorLog(
3338
'Validation Failed: Your Faust front-end site URL value is misconfigured. It should NOT match the `NEXT_PUBLIC_WORDPRESS_URL.`',

0 commit comments

Comments
 (0)