refactor: update deno_core for error refactor (#26867)

Closes #26171

---------

Co-authored-by: David Sherret <dsherret@gmail.com>
This commit is contained in:
Leo Kettmeir 2025-01-08 14:52:32 -08:00 committed by GitHub
parent 814da49dff
commit ea30e188a8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
214 changed files with 3787 additions and 4210 deletions

View file

@ -126,20 +126,27 @@ deno_core::extension!(deno_web,
}
);
#[derive(Debug, thiserror::Error)]
#[derive(Debug, thiserror::Error, deno_error::JsError)]
pub enum WebError {
#[class("DOMExceptionInvalidCharacterError")]
#[error("Failed to decode base64")]
Base64Decode,
#[class(range)]
#[error("The encoding label provided ('{0}') is invalid.")]
InvalidEncodingLabel(String),
#[class(type)]
#[error("buffer exceeds maximum length")]
BufferTooLong,
#[class(range)]
#[error("Value too large to decode")]
ValueTooLarge,
#[class(range)]
#[error("Provided buffer too small")]
BufferTooSmall,
#[class(type)]
#[error("The encoded data is not valid")]
DataInvalid,
#[class(generic)]
#[error(transparent)]
DataError(#[from] v8::DataError),
}