ui: display error dialog when saving subnet routes fails (#604)
Fixes tailscale/corp#26175 When setting subnet routing settings, for a variety of reasons the Tailscale backend may reject an entered value with a 400 error. Here we handle such errors in a user-facing fashion: - We display an ErrorDialog with title 'Failed to save' and whatever error message the backend request returned. To do so, we introduce a new initializer for ErrorDialog that accepts a runtime-generated String instead of a fixed string resource. - We ask the backend to provide an updated value of AdvertiseRoutes whenever the error dialog is dismissed by the user, and set it as the UI state, to ensure consistency between UI and backend upon a failed save. Signed-off-by: Andrea Gottardo <andrea@gottardo.me>pull/606/head
parent
0ed18a2b0a
commit
56d7be331e
Loading…
Reference in New Issue