on_error.sql handler for errors

Đang mở
#946 2 bình luận 1 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
5/5
Thời gian dự kiến
Hơn một tuần
Mức phù hợp với người mới
35/100
Loại issue
Tính năng
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
rust, sql
Lĩnh vực
api, backend

Hướng nghiên cứu

The issue proposes an on_error.sql handler but does not identify a code entry point or test. First, trace how errors are rendered and how SQL pages are executed, including the production behavior of error.handlebars; the reporter says they could not find where to insert the handler. Done would mean a defined handler receives the error details and can perform SQL operations, with tests covering the behavior.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

enhancement

What are you building with SQLPage ?

An application in the healthcare industry.

What is your problem ?

We would like to log errors that our users encounter and potentially create tickets in our support system when a user receives an error message.

Describe the solution you'd like

It would be great if there was an on_error.sql handler that received the error message, URL, sqlpage.variables() and also the backtrace. It would be cool if we could write this with SQL as any other SQL page, and insert the log into our database and potentially execute other operations like fetch() to call out to other systems (to send an email, create a ticket, etc.)

Describe alternatives you've considered

There are no really good alternatives currently available because in production environment we do not get the backtrace in error.handlerbars, so we can't even log the error somehow from the user's browser. The error is essentially lost.

Additional context

I've taken a stab in the rust at creating this as pull request, but I cannot find a good place in the code to insert this handler. If you could give some ideas as to where a good handler code might live, I could submit as a PR.

Ngôn ngữ chính
Rust
Star
2.6k
Fork
175
Merge trung bình
14 giờ 16 phút
Pull request đã merge (30 ngày)
43

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của sqlpage/SQLPage

Tất cả issue của sqlpage/SQLPage

Issue tương tự

Thêm issue về Rust

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.