We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b524d98 commit 499c8b4Copy full SHA for 499c8b4
worker/src/kv/mod.rs
@@ -173,6 +173,21 @@ pub enum KvError {
173
InvalidKvStore(String),
174
}
175
176
+unsafe impl Send for KvError {}
177
+unsafe impl Sync for KvError {}
178
+
179
+impl std::fmt::Display for KvError {
180
+ fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
181
+ match self {
182
+ KvError::JavaScript(value) => write!(f, "js error: {value:?}"),
183
+ KvError::Serialization(e) => write!(f, "unable to serialize/deserialize: {e}"),
184
+ KvError::InvalidKvStore(binding) => write!(f, "invalid kv store: {binding}"),
185
+ }
186
187
+}
188
189
+impl std::error::Error for KvError {}
190
191
impl From<KvError> for JsValue {
192
fn from(val: KvError) -> Self {
193
match val {
0 commit comments