Skip to content

Commit e04c68e

Browse files
committed
doc(*) : Document errors
- Add a chapter about format of errors
1 parent ef15948 commit e04c68e

File tree

1 file changed

+19
-2
lines changed

1 file changed

+19
-2
lines changed

README.adoc

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ StreamdataClient.createRxJavaClient(apiURL, appKey)
104104
} else if (event.isPatch()) {
105105
this.processData(event.getPatch(), event.getSnapshot())
106106
} else if (event.isError()) {
107-
throw new RuntimeException(event.getError()); # <6>
107+
throw new RuntimeException(event.getError().toString()); # <6>
108108
}
109109
}, err -> logger.error(err.getMessage(), err));
110110
@@ -114,4 +114,21 @@ StreamdataClient.createRxJavaClient(apiURL, appKey)
114114
<3> Same as above
115115
<4> Once configured you can start manipulating you data
116116
<5> An example without using any rx operators before show you available methods on event
117-
<6> Shis will stop the flowable and disconnect the event source
117+
<6> Shis will stop the flowable and disconnect the event source
118+
119+
== Errors
120+
121+
Errors not a simple string. It is JSON !
122+
123+
Above, an example of an error so you can get more detailed informations
124+
125+
[JSON]
126+
```
127+
{
128+
"status":2005,
129+
"cause":"An error occurred while streaming http://stockmarket.streamdata.io/priceshttp://stockmarket.streamdata.io/prices. : HTTP/1.1 404 ",
130+
"message":"HTTP error. The Http response cannot be processed.",
131+
"timestamp":1512566770744,
132+
"sessionId":"62fd67bc-d090-4333-a783-d94b366f55f4"
133+
}
134+
```

0 commit comments

Comments
 (0)