aboutsummaryrefslogtreecommitdiff
path: root/src/model/error.rs
diff options
context:
space:
mode:
authorZeyla Hellyer <[email protected]>2018-02-04 07:50:53 -0800
committerZeyla Hellyer <[email protected]>2018-02-04 07:54:31 -0800
commita9966371def331cd848f642e222627ee9decf354 (patch)
tree316c75854ddea79230f98b66708c3f815b836227 /src/model/error.rs
parentPartially revert the video url change (diff)
downloadserenity-a9966371def331cd848f642e222627ee9decf354.tar.xz
serenity-a9966371def331cd848f642e222627ee9decf354.zip
Rewrite the library to use Futures
Rewrites the library to use Futures. This rewrites all of the gateway, client, cache, most model methods, HTTP, and in a later commit the framework and voice. HTTP has been mostly rewritten to be ergonomic so that it can be used by the user, and has been upgraded to hyper v0.11. The gateway now uses `tokio-tungstenite` v0.4. The client isn't yet in a working state. The models now have a `client` optionally attached to them to make use of `http` and `cache`-utilizing methods. The client isn't needed, in the case that someone is using the library just to deserialize models. The cache is now built around `Rc`s and `RefCell`s, instead of `Arc`s and `RwLock`s. Refer to example 01 for a working example. Much of the library still doesn't work.
Diffstat (limited to 'src/model/error.rs')
-rw-r--r--src/model/error.rs4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/model/error.rs b/src/model/error.rs
index ea919bc..58fe647 100644
--- a/src/model/error.rs
+++ b/src/model/error.rs
@@ -73,6 +73,9 @@ pub enum Error {
/// When attempting to delete below or above the minimum and maximum allowed
/// number of messages.
BulkDeleteAmount,
+ /// The client wasn't present on the model when it was expected to be, e.g.
+ /// when performing a cache or HTTP operation on it.
+ ClientNotPresent,
/// When attempting to delete a number of days' worth of messages that is
/// not allowed.
DeleteMessageDaysAmount(u8),
@@ -131,6 +134,7 @@ impl StdError for Error {
fn description(&self) -> &str {
match *self {
Error::BulkDeleteAmount => "Too few/many messages to bulk delete",
+ Error::ClientNotPresent => "The client wasn't present on the model",
Error::DeleteMessageDaysAmount(_) => "Invalid delete message days",
Error::EmbedTooLarge(_) => "Embed too large",
Error::GuildNotFound => "Guild not found in the cache",