Merge remote-tracking branch 'origin/master'

This commit is contained in:
2026-02-14 19:44:53 +03:00
parent ce110ed86f
commit 237f73a923
3 changed files with 47 additions and 6 deletions

View File

@@ -10,6 +10,7 @@ import (
"fmt"
"log"
"net/http"
"runtime/debug"
"sort"
"strings"
"time"
@@ -421,7 +422,8 @@ func ExportPDFHandler(mssql *sql.DB) http.HandlerFunc {
defer func() {
if rec := recover(); rec != nil {
log.Printf("❌ PANIC ExportPDFHandler: %v", rec)
http.Error(w, "PDF oluşturulurken hata oluştu", http.StatusInternalServerError)
debug.PrintStack()
http.Error(w, fmt.Sprintf("PDF oluşturulurken panic oluştu: %v", rec), http.StatusInternalServerError)
}
}()
@@ -603,6 +605,11 @@ func ExportPDFHandler(mssql *sql.DB) http.HandlerFunc {
}
// 7) Çıktı
if err := pdf.Error(); err != nil {
http.Error(w, "PDF render hatası: "+err.Error(), http.StatusInternalServerError)
return
}
var buf bytes.Buffer
if err := pdf.Output(&buf); err != nil {
http.Error(w, "PDF oluşturulamadı: "+err.Error(), http.StatusInternalServerError)