From 219241076a13526ccf16e6bc77d0d6b01c61ab39 Mon Sep 17 00:00:00 2001 From: andrekir Date: Sat, 23 Sep 2023 06:55:25 -0300 Subject: [PATCH] refactor: improve `exportProfile` exception handling --- app/src/main/java/com/geeksville/mesh/model/UIState.kt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/com/geeksville/mesh/model/UIState.kt b/app/src/main/java/com/geeksville/mesh/model/UIState.kt index b4c473c3a..e51672f09 100644 --- a/app/src/main/java/com/geeksville/mesh/model/UIState.kt +++ b/app/src/main/java/com/geeksville/mesh/model/UIState.kt @@ -723,8 +723,10 @@ class UIViewModel @Inject constructor( message.writeTo(outputStream) } } - } catch (ex: FileNotFoundException) { + } catch (ex: Exception) { + val error = "${ex.javaClass.simpleName}: ${ex.message}" errormsg("Can't write file error: ${ex.message}") + setResponseStateError(error) } }