Handle error on save

Signed-off-by: Alexey Gladkov <gladkov.alexey@gmail.com>