diff --git a/barobill_registration/api.php b/barobill_registration/api.php index 960efd8..fcb23e0 100644 --- a/barobill_registration/api.php +++ b/barobill_registration/api.php @@ -1,9 +1,13 @@ 'Method not allowed']); break; } -} catch (Exception $e) { +} catch (Throwable $e) { http_response_code(500); echo json_encode([ 'error' => 'Backend Error', diff --git a/barobill_registration/index.php b/barobill_registration/index.php index 9c52fb5..a7a1bd5 100644 --- a/barobill_registration/index.php +++ b/barobill_registration/index.php @@ -213,7 +213,7 @@ setMembers(data.members || []); } catch (parseError) { console.error("Invalid JSON response:", text); - alert("서버로부터 올바르지 않은 응답이 수신되었습니다. DB 연결 또는 테이블 생성 여부를 확인해주세요."); + alert("서버로부터 올바르지 않은 응답이 수신되었습니다.\n\n[응답 내용]\n" + text.substring(0, 200) + (text.length > 200 ? '...' : '') + "\n\n요소: DB 연동 또는 테이블(init_db.php) 상태를 확인해주세요."); } } catch (e) { console.error(e); diff --git a/barobill_registration/init_db.php b/barobill_registration/init_db.php index 6773c97..fb6abc4 100644 --- a/barobill_registration/init_db.php +++ b/barobill_registration/init_db.php @@ -1,11 +1,14 @@ exec($sql); echo "Table 'barobill_members' initialized successfully."; -} catch (Exception $e) { - echo "Error: " . $e->getMessage(); +} catch (Throwable $e) { + echo "Error: [" . get_class($e) . "] " . $e->getMessage(); }