about summary refs log tree commit diff
path: root/src/libstd/error.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/libstd/error.rs')
-rw-r--r--src/libstd/error.rs10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/libstd/error.rs b/src/libstd/error.rs
index cd7d9aacc90..9a46a500a4b 100644
--- a/src/libstd/error.rs
+++ b/src/libstd/error.rs
@@ -81,6 +81,7 @@
 use prelude::*;
 
 use str::Utf8Error;
+use string::{FromUtf8Error, FromUtf16Error};
 
 /// Base functionality for all errors in Rust.
 pub trait Error: Send {
@@ -117,3 +118,12 @@ impl Error for Utf8Error {
 
     fn detail(&self) -> Option<String> { Some(self.to_string()) }
 }
+
+impl Error for FromUtf8Error {
+    fn description(&self) -> &str { "invalid utf-8" }
+    fn detail(&self) -> Option<String> { Some(self.to_string()) }
+}
+
+impl Error for FromUtf16Error {
+    fn description(&self) -> &str { "invalid utf-16" }
+}