diff options
Diffstat (limited to 'extensions/webstorage/lib.rs')
-rw-r--r-- | extensions/webstorage/lib.rs | 34 |
1 files changed, 4 insertions, 30 deletions
diff --git a/extensions/webstorage/lib.rs b/extensions/webstorage/lib.rs index d2170890e..595a6b7dd 100644 --- a/extensions/webstorage/lib.rs +++ b/extensions/webstorage/lib.rs @@ -138,8 +138,10 @@ pub fn op_webstorage_set( if size >= 5000000 { return Err( - DomExceptionQuotaExceededError::new("Exceeded maximum storage size") - .into(), + deno_web::DomExceptionQuotaExceededError::new( + "Exceeded maximum storage size", + ) + .into(), ); } @@ -213,34 +215,6 @@ pub fn op_webstorage_iterate_keys( } #[derive(Debug)] -pub struct DomExceptionQuotaExceededError { - pub msg: String, -} - -impl DomExceptionQuotaExceededError { - pub fn new(msg: &str) -> Self { - DomExceptionQuotaExceededError { - msg: msg.to_string(), - } - } -} - -impl fmt::Display for DomExceptionQuotaExceededError { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.pad(&self.msg) - } -} - -impl std::error::Error for DomExceptionQuotaExceededError {} - -pub fn get_quota_exceeded_error_class_name( - e: &AnyError, -) -> Option<&'static str> { - e.downcast_ref::<DomExceptionQuotaExceededError>() - .map(|_| "DOMExceptionQuotaExceededError") -} - -#[derive(Debug)] pub struct DomExceptionNotSupportedError { pub msg: String, } |