aboutsummaryrefslogtreecommitdiff
path: root/src/voice/error.rs
diff options
context:
space:
mode:
authorMaiddog <[email protected]>2017-08-26 17:55:43 -0500
committeralex <[email protected]>2017-08-27 00:55:43 +0200
commit3e0b1032d80a1847558a752e8316d97f9ae58f04 (patch)
treeca65390091cb3c0ab98b6497a1447ba69df3d20d /src/voice/error.rs
parentUse `$crate` for `Args` (diff)
downloadserenity-3e0b1032d80a1847558a752e8316d97f9ae58f04.tar.xz
serenity-3e0b1032d80a1847558a752e8316d97f9ae58f04.zip
Add ability to play DCA and Opus files. (#148)
Diffstat (limited to 'src/voice/error.rs')
-rw-r--r--src/voice/error.rs30
1 files changed, 23 insertions, 7 deletions
diff --git a/src/voice/error.rs b/src/voice/error.rs
index b756bfb..a0bb11a 100644
--- a/src/voice/error.rs
+++ b/src/voice/error.rs
@@ -1,5 +1,6 @@
-use serde_json::Value;
+use serde_json::{self, Value};
use std::process::Output;
+use std;
/// An error returned from the voice module.
// Errors which are not visible to the end user are hidden.
@@ -7,14 +8,20 @@ use std::process::Output;
pub enum VoiceError {
/// An indicator that an endpoint URL was invalid.
EndpointUrl,
- #[doc(hidden)] ExpectedHandshake,
- #[doc(hidden)] FindingByte,
- #[doc(hidden)] HostnameResolve,
- #[doc(hidden)] KeyGen,
+ #[doc(hidden)]
+ ExpectedHandshake,
+ #[doc(hidden)]
+ FindingByte,
+ #[doc(hidden)]
+ HostnameResolve,
+ #[doc(hidden)]
+ KeyGen,
/// An error occurred while checking if a path is stereo.
Streams,
- #[doc(hidden)] VoiceModeInvalid,
- #[doc(hidden)] VoiceModeUnavailable,
+ #[doc(hidden)]
+ VoiceModeInvalid,
+ #[doc(hidden)]
+ VoiceModeUnavailable,
/// An error occurred while running `youtube-dl`.
YouTubeDLRun(Output),
/// An error occurred while processing the JSON output from `youtube-dl`.
@@ -26,3 +33,12 @@ pub enum VoiceError {
/// The JSON output is given.
YouTubeDLUrl(Value),
}
+
+/// An error returned from the dca method.
+#[derive(Debug)]
+pub enum DcaError {
+ IoError(std::io::Error),
+ InvalidHeader,
+ InvalidMetadata(serde_json::Error),
+ InvalidSize(i32),
+}