Closed obfuscurity closed 11 years ago
When the user attempts to add a duplicate graph id to a dashboard, the constraint violation gets passed up as a 500 error to the console:
Sequel::DatabaseError: PG::Error: ERROR: duplicate key value violates unique constraint "graph_dashboard_relations_graph_id_dashboard_id_key" DETAIL: Key (graph_id, dashboard_id)=(86, 21) already exists.
Instead, we should catch the exception, skip the offending graph, and return a visible warning to the user.
Better idea... simply catch the exception and redirect the user to the desired dashboard. Win-win-win.
When the user attempts to add a duplicate graph id to a dashboard, the constraint violation gets passed up as a 500 error to the console:
Instead, we should catch the exception, skip the offending graph, and return a visible warning to the user.