Browse Source

log exceptions

Signed-off-by: Marcel Hibbe <dev@mhibbe.de>
Marcel Hibbe 4 years ago
parent
commit
cc5d3d968e

+ 4 - 4
app/src/main/java/com/nextcloud/talk/components/filebrowser/models/properties/NCEncrypted.java

@@ -21,6 +21,8 @@
 package com.nextcloud.talk.components.filebrowser.models.properties;
 package com.nextcloud.talk.components.filebrowser.models.properties;
 
 
 import android.text.TextUtils;
 import android.text.TextUtils;
+import android.util.Log;
+
 import at.bitfire.dav4android.Property;
 import at.bitfire.dav4android.Property;
 import at.bitfire.dav4android.PropertyFactory;
 import at.bitfire.dav4android.PropertyFactory;
 import at.bitfire.dav4android.XmlUtils;
 import at.bitfire.dav4android.XmlUtils;
@@ -55,10 +57,8 @@ public class NCEncrypted implements Property {
                 if (!TextUtils.isEmpty(text)) {
                 if (!TextUtils.isEmpty(text)) {
                     return new NCEncrypted(Boolean.parseBoolean(text));
                     return new NCEncrypted(Boolean.parseBoolean(text));
                 }
                 }
-            } catch (IOException e) {
-                e.printStackTrace();
-            } catch (XmlPullParserException e) {
-                e.printStackTrace();
+            } catch (IOException | XmlPullParserException e) {
+                Log.e("NCEncrypted", "failed to create property", e);
             }
             }
 
 
             return new NCEncrypted(false);
             return new NCEncrypted(false);

+ 5 - 4
app/src/main/java/com/nextcloud/talk/components/filebrowser/models/properties/NCPermission.java

@@ -3,6 +3,8 @@
  *
  *
  * @author Mario Danic
  * @author Mario Danic
  * Copyright (C) 2017-2019 Mario Danic <mario@lovelyhq.com>
  * Copyright (C) 2017-2019 Mario Danic <mario@lovelyhq.com>
+ * @author Marcel Hibbe
+ * Copyright (C) 2021 Marcel Hibbe <dev@mhibbe.de>
  *
  *
  * This program is free software: you can redistribute it and/or modify
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * it under the terms of the GNU General Public License as published by
@@ -21,6 +23,7 @@
 package com.nextcloud.talk.components.filebrowser.models.properties;
 package com.nextcloud.talk.components.filebrowser.models.properties;
 
 
 import android.text.TextUtils;
 import android.text.TextUtils;
+import android.util.Log;
 
 
 import com.nextcloud.talk.components.filebrowser.webdav.DavUtils;
 import com.nextcloud.talk.components.filebrowser.webdav.DavUtils;
 
 
@@ -58,10 +61,8 @@ public class NCPermission implements Property {
                 if (!TextUtils.isEmpty(text)) {
                 if (!TextUtils.isEmpty(text)) {
                     return new NCPermission(text);
                     return new NCPermission(text);
                 }
                 }
-            } catch (IOException e) {
-                e.printStackTrace();
-            } catch (XmlPullParserException e) {
-                e.printStackTrace();
+            } catch (IOException | XmlPullParserException e) {
+                Log.e("NCPermission", "failed to create property", e);
             }
             }
 
 
             return new NCPermission("");
             return new NCPermission("");

+ 4 - 4
app/src/main/java/com/nextcloud/talk/components/filebrowser/models/properties/NCPreview.java

@@ -21,6 +21,8 @@
 package com.nextcloud.talk.components.filebrowser.models.properties;
 package com.nextcloud.talk.components.filebrowser.models.properties;
 
 
 import android.text.TextUtils;
 import android.text.TextUtils;
+import android.util.Log;
+
 import at.bitfire.dav4android.Property;
 import at.bitfire.dav4android.Property;
 import at.bitfire.dav4android.PropertyFactory;
 import at.bitfire.dav4android.PropertyFactory;
 import at.bitfire.dav4android.XmlUtils;
 import at.bitfire.dav4android.XmlUtils;
@@ -55,10 +57,8 @@ public class NCPreview implements Property {
                 if (!TextUtils.isEmpty(text)) {
                 if (!TextUtils.isEmpty(text)) {
                     return new NCPreview(Boolean.parseBoolean(text));
                     return new NCPreview(Boolean.parseBoolean(text));
                 }
                 }
-            } catch (IOException e) {
-                e.printStackTrace();
-            } catch (XmlPullParserException e) {
-                e.printStackTrace();
+            } catch (IOException | XmlPullParserException e) {
+                Log.e("NCPreview", "failed to create property", e);
             }
             }
 
 
             return new OCFavorite(false);
             return new OCFavorite(false);

+ 4 - 4
app/src/main/java/com/nextcloud/talk/components/filebrowser/models/properties/OCFavorite.java

@@ -21,6 +21,8 @@
 package com.nextcloud.talk.components.filebrowser.models.properties;
 package com.nextcloud.talk.components.filebrowser.models.properties;
 
 
 import android.text.TextUtils;
 import android.text.TextUtils;
+import android.util.Log;
+
 import at.bitfire.dav4android.Property;
 import at.bitfire.dav4android.Property;
 import at.bitfire.dav4android.PropertyFactory;
 import at.bitfire.dav4android.PropertyFactory;
 import at.bitfire.dav4android.XmlUtils;
 import at.bitfire.dav4android.XmlUtils;
@@ -55,10 +57,8 @@ public class OCFavorite implements Property {
                 if (!TextUtils.isEmpty(text)) {
                 if (!TextUtils.isEmpty(text)) {
                     return new OCFavorite(Boolean.parseBoolean(text));
                     return new OCFavorite(Boolean.parseBoolean(text));
                 }
                 }
-            } catch (IOException e) {
-                e.printStackTrace();
-            } catch (XmlPullParserException e) {
-                e.printStackTrace();
+            } catch (IOException | XmlPullParserException e) {
+                Log.e("OCFavorite", "failed to create property", e);
             }
             }
 
 
             return new OCFavorite(false);
             return new OCFavorite(false);

+ 4 - 4
app/src/main/java/com/nextcloud/talk/components/filebrowser/models/properties/OCId.java

@@ -21,6 +21,8 @@
 package com.nextcloud.talk.components.filebrowser.models.properties;
 package com.nextcloud.talk.components.filebrowser.models.properties;
 
 
 import android.text.TextUtils;
 import android.text.TextUtils;
+import android.util.Log;
+
 import at.bitfire.dav4android.Property;
 import at.bitfire.dav4android.Property;
 import at.bitfire.dav4android.PropertyFactory;
 import at.bitfire.dav4android.PropertyFactory;
 import at.bitfire.dav4android.XmlUtils;
 import at.bitfire.dav4android.XmlUtils;
@@ -55,10 +57,8 @@ public class OCId implements Property {
                 if (!TextUtils.isEmpty(text)) {
                 if (!TextUtils.isEmpty(text)) {
                     return new OCId(text);
                     return new OCId(text);
                 }
                 }
-            } catch (IOException e) {
-                e.printStackTrace();
-            } catch (XmlPullParserException e) {
-                e.printStackTrace();
+            } catch (IOException | XmlPullParserException e) {
+                Log.e("OCId", "failed to create property", e);
             }
             }
 
 
             return new OCId("");
             return new OCId("");

+ 4 - 4
app/src/main/java/com/nextcloud/talk/components/filebrowser/models/properties/OCSize.java

@@ -21,6 +21,8 @@
 package com.nextcloud.talk.components.filebrowser.models.properties;
 package com.nextcloud.talk.components.filebrowser.models.properties;
 
 
 import android.text.TextUtils;
 import android.text.TextUtils;
+import android.util.Log;
+
 import at.bitfire.dav4android.Property;
 import at.bitfire.dav4android.Property;
 import at.bitfire.dav4android.PropertyFactory;
 import at.bitfire.dav4android.PropertyFactory;
 import at.bitfire.dav4android.XmlUtils;
 import at.bitfire.dav4android.XmlUtils;
@@ -56,10 +58,8 @@ public class OCSize implements Property {
                 if (!TextUtils.isEmpty(text)) {
                 if (!TextUtils.isEmpty(text)) {
                     return new OCSize(Long.parseLong(text));
                     return new OCSize(Long.parseLong(text));
                 }
                 }
-            } catch (IOException e) {
-                e.printStackTrace();
-            } catch (XmlPullParserException e) {
-                e.printStackTrace();
+            } catch (IOException | XmlPullParserException e) {
+                Log.e("OCSize", "failed to create property", e);
             }
             }
 
 
             return new OCSize(-1);
             return new OCSize(-1);