8000 Unhandled unique key violation · Issue #190 · dbrgn/flugbuech · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Unhandled unique key violation #190

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
dbrgn opened this issue Mar 30, 2025 · 0 comments
Open

Unhandled unique key violation #190

dbrgn opened this issue Mar 30, 2025 · 0 comments
Labels
bug Something isn't working

Comments

@dbrgn
Copy link
Owner
dbrgn commented Mar 30, 2025

When flight number is already used:

POST /api/v1/flights/ application/json:
   >> Matched: (add) POST /api/v1/flights
thread 'rocket-worker-thread' panicked at src/data.rs:274:6:
Transaction for create_flight failed: DatabaseError(UniqueViolation, "duplicate key value violates unique constraint \"flights_user_id_number_key\"")
stack backtrace:
   0: rust_begin_unwind
   1: core::panicking::panic_fmt
   2: core::result::unwrap_failed
   3: flugbuech_api::data::create_flight
   4: <tokio::runtime::blocking::task::BlockingTask<T> as core::future::future::Future>::poll
   5: tokio::runtime::task::core::Core<T,S>::poll
   6: tokio::runtime::task::harness::Harness<T,S>::poll
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
   >> Handler add panicked.
   >> This is an application bug.
   >> A panic in Rust must be treated as an exceptional event.
   >> Panicking is not a suitable error handling mechanism.
   >> Unwinding, the result of a panic, is an expensive operation.
   >> Panics will degrade application performance.
   >> Instead of panicking, return `Option` and/or `Result`.
   >> Values of either type can be returned directly from handlers.
   >> A panic is treated as an internal server error.
   >> Outcome: Error(500 Internal Server Error)
   >> No 500 catcher registered. Using Rocket default.
   >> Response succeeded.

In addition, the UI does not show anything when the 500 happens.

@dbrgn dbrgn added the bug Something isn't working label Mar 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant
0