Quantcast
Channel: Syncthing Community Forum - Latest topics
Viewing all articles
Browse latest Browse all 6194

A wish for "failure events" returned by the getEvents API

$
0
0

Hi,

I’m currently testing some Android wrapper updates and hit this error:

2021-09-19 13:27:07.730 27549-27549/com.github.catfriend1.syncthingandroid.debug E/RestApi: getEvents: Skipping event due to JsonSyntaxException, raw=[{"id":20,"globalID":20,"time":"2021-09-19T11:27:03.379654Z","type":"Failure","data":"can't encrypt outgoing data because local data is encrypted (folder-type receive-encrypted)"}]

It doesn’t parse into my error Event.class which is defined like this:

public class Event {

    public int id;
    public int globalID;
    public String type;
    public String time;
    public Map<String, Object> data;

}

Can we please return some “Map<String, Object>” for “data”?

Alternatively, I would have to try…catch that one exceptional error message and parse it into:

public class Event2 {

public int id;
public int globalID;
public String type;
public String time;
public <String> data;

}

Relevant code is at: https://github.com/Catfriend1/syncthing-android/blob/7a4de953bf0ead327c54e4f0144e2f94e1d6fb53/app/src/main/java/com/nutomic/syncthingandroid/service/RestApi.java#L982

4 posts - 3 participants

Read full topic


Viewing all articles
Browse latest Browse all 6194

Trending Articles