summaryrefslogtreecommitdiffstats
path: root/ipfs-api/src/client.rs
diff options
context:
space:
mode:
authorFerris Tseng <ferristseng@gmail.com>2018-08-04 12:04:04 -0400
committerGitHub <noreply@github.com>2018-08-04 12:04:04 -0400
commitc37a49f137637c1041186143788460e5ddf28822 (patch)
treefc391010f988df107916331629211573afde8ba2 /ipfs-api/src/client.rs
parent8ddbbd1854f86a15d522247993e6c6ce39db1781 (diff)
parent7692800f95117cedeca2c40725186b0feacb1187 (diff)
Merge pull request #17 from leodasvacas/switch-from-error-chain-to-failure
Switch from error-chain to failure
Diffstat (limited to 'ipfs-api/src/client.rs')
-rw-r--r--ipfs-api/src/client.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/ipfs-api/src/client.rs b/ipfs-api/src/client.rs
index 2e07b29..c933e89 100644
--- a/ipfs-api/src/client.rs
+++ b/ipfs-api/src/client.rs
@@ -10,7 +10,7 @@ use futures::{Future, IntoFuture, stream::{self, Stream}};
use header::TRAILER;
use read::{JsonLineDecoder, LineDecoder, StreamReader};
use request::{self, ApiRequest};
-use response::{self, Error, ErrorKind};
+use response::{self, Error};
use http::uri::InvalidUri;
use hyper::{self, Chunk, Request, Response, StatusCode, Uri, client::{Client, HttpConnector}};
use hyper_multipart::client::multipart;
@@ -98,9 +98,9 @@ impl IpfsClient {
#[inline]
fn build_error_from_body(chunk: Chunk) -> Error {
match serde_json::from_slice(&chunk) {
- Ok(e) => ErrorKind::Api(e).into(),
+ Ok(e) => Error::Api(e).into(),
Err(_) => match String::from_utf8(chunk.to_vec()) {
- Ok(s) => ErrorKind::Uncategorized(s).into(),
+ Ok(s) => Error::Uncategorized(s).into(),
Err(e) => e.into(),
},
}
@@ -290,7 +290,7 @@ impl IpfsClient {
if trailer == "X-Stream-Error" {
true
} else {
- let err = ErrorKind::UnrecognizedTrailerHeader(
+ let err = Error::UnrecognizedTrailerHeader(
String::from_utf8_lossy(trailer.as_ref()).into(),
);