log exceptions

Signed-off-by: Marcel Hibbe <dev@mhibbe.de>
This commit is contained in:
Marcel Hibbe 2021-04-07 10:00:29 +02:00
parent 68c09d8e81
commit cc5d3d968e
No known key found for this signature in database
GPG Key ID: C793F8B59F43CE7B
6 changed files with 25 additions and 24 deletions

View File

@ -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) { } catch (IOException | XmlPullParserException e) {
e.printStackTrace(); Log.e("NCEncrypted", "failed to create property", e);
} catch (XmlPullParserException e) {
e.printStackTrace();
} }
return new NCEncrypted(false); return new NCEncrypted(false);

View File

@ -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) { } catch (IOException | XmlPullParserException e) {
e.printStackTrace(); Log.e("NCPermission", "failed to create property", e);
} catch (XmlPullParserException e) {
e.printStackTrace();
} }
return new NCPermission(""); return new NCPermission("");

View File

@ -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) { } catch (IOException | XmlPullParserException e) {
e.printStackTrace(); Log.e("NCPreview", "failed to create property", e);
} catch (XmlPullParserException e) {
e.printStackTrace();
} }
return new OCFavorite(false); return new OCFavorite(false);

View File

@ -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) { } catch (IOException | XmlPullParserException e) {
e.printStackTrace(); Log.e("OCFavorite", "failed to create property", e);
} catch (XmlPullParserException e) {
e.printStackTrace();
} }
return new OCFavorite(false); return new OCFavorite(false);

View File

@ -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) { } catch (IOException | XmlPullParserException e) {
e.printStackTrace(); Log.e("OCId", "failed to create property", e);
} catch (XmlPullParserException e) {
e.printStackTrace();
} }
return new OCId(""); return new OCId("");

View File

@ -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) { } catch (IOException | XmlPullParserException e) {
e.printStackTrace(); Log.e("OCSize", "failed to create property", e);
} catch (XmlPullParserException e) {
e.printStackTrace();
} }
return new OCSize(-1); return new OCSize(-1);