feat/booking-panel #27
@ -147,9 +147,10 @@ export async function createAppointment(
|
|||||||
let errorMessage = `Server error (${response.status}): ${response.statusText || 'Internal Server Error'}`;
|
let errorMessage = `Server error (${response.status}): ${response.statusText || 'Internal Server Error'}`;
|
||||||
|
|
||||||
// Try to find error details in HTML
|
// Try to find error details in HTML
|
||||||
const errorMatch = responseText.match(/<pre[^>]*>(.*?)<\/pre>/is) ||
|
// Use [\s\S] instead of . with s flag for better compatibility
|
||||||
responseText.match(/<h1[^>]*>(.*?)<\/h1>/is) ||
|
const errorMatch = responseText.match(/<pre[^>]*>([\s\S]*?)<\/pre>/i) ||
|
||||||
responseText.match(/<title[^>]*>(.*?)<\/title>/is);
|
responseText.match(/<h1[^>]*>([\s\S]*?)<\/h1>/i) ||
|
||||||
|
responseText.match(/<title[^>]*>([\s\S]*?)<\/title>/i);
|
||||||
|
|
||||||
if (errorMatch && errorMatch[1]) {
|
if (errorMatch && errorMatch[1]) {
|
||||||
const htmlError = errorMatch[1].replace(/<[^>]*>/g, '').trim();
|
const htmlError = errorMatch[1].replace(/<[^>]*>/g, '').trim();
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user