summaryrefslogtreecommitdiff
path: root/src/errors.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/errors.rs')
-rw-r--r--src/errors.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/errors.rs b/src/errors.rs
index 8fb2793..544c391 100644
--- a/src/errors.rs
+++ b/src/errors.rs
@@ -1,8 +1,8 @@
use rocket::http::ContentType;
use rocket::request::Request;
use rocket::response::{self, Responder, Response};
-use rspotify::spotify::client::ApiError;
-use rspotify::spotify::oauth2::SpotifyOAuth;
+use rspotify::client::ApiError;
+use rspotify::oauth2::SpotifyOAuth;
use std::collections::HashMap;
use std::io::Cursor;
use std::sync::{MutexGuard, PoisonError};
@@ -49,7 +49,7 @@ impl<'a> From<std::option::NoneError> for Error {
Error::Misc(format!("tried to unwrap none at: {:?}", error))
}
}
-impl<'a> Responder<'a> for Error {
+impl<'a> Responder<'a, 'a> for Error {
fn respond_to(self, _: &Request) -> response::Result<'a> {
let response = match self {
Error::Postgres(e) => format!("DB Error: {:?}", e),
@@ -59,7 +59,7 @@ impl<'a> Responder<'a> for Error {
Response::build()
.header(ContentType::Plain)
.status(rocket::http::Status::raw(500))
- .sized_body(Cursor::new(response))
+ .sized_body(response.len(), Cursor::new(response))
.ok()
}
}