mirror of
https://github.com/servo/servo.git
synced 2025-08-11 08:25:32 +01:00
Refactor Bluetooth error handling
This commit is contained in:
parent
d8991496c6
commit
b4db14471b
7 changed files with 76 additions and 62 deletions
|
@ -12,7 +12,7 @@ use dom::bindings::codegen::Bindings::BluetoothRemoteGATTCharacteristicBinding::
|
|||
BluetoothRemoteGATTCharacteristicMethods;
|
||||
use dom::bindings::codegen::Bindings::BluetoothRemoteGATTServerBinding::BluetoothRemoteGATTServerMethods;
|
||||
use dom::bindings::codegen::Bindings::BluetoothRemoteGATTServiceBinding::BluetoothRemoteGATTServiceMethods;
|
||||
use dom::bindings::error::Error::{InvalidModification, Network, NotSupported, Security, Type};
|
||||
use dom::bindings::error::Error::{self, InvalidModification, Network, NotSupported, Security};
|
||||
use dom::bindings::error::{Fallible, ErrorResult};
|
||||
use dom::bindings::global::GlobalRef;
|
||||
use dom::bindings::js::{JS, MutHeap, Root};
|
||||
|
@ -115,7 +115,7 @@ impl BluetoothRemoteGATTCharacteristicMethods for BluetoothRemoteGATTCharacteris
|
|||
descriptor.instance_id))
|
||||
},
|
||||
Err(error) => {
|
||||
Err(Type(error))
|
||||
Err(Error::from(error))
|
||||
},
|
||||
}
|
||||
}
|
||||
|
@ -147,7 +147,7 @@ impl BluetoothRemoteGATTCharacteristicMethods for BluetoothRemoteGATTCharacteris
|
|||
.collect())
|
||||
},
|
||||
Err(error) => {
|
||||
Err(Type(error))
|
||||
Err(Error::from(error))
|
||||
},
|
||||
}
|
||||
}
|
||||
|
@ -177,7 +177,7 @@ impl BluetoothRemoteGATTCharacteristicMethods for BluetoothRemoteGATTCharacteris
|
|||
ByteString::new(val)
|
||||
},
|
||||
Err(error) => {
|
||||
return Err(Type(error))
|
||||
return Err(Error::from(error))
|
||||
},
|
||||
};
|
||||
*self.value.borrow_mut() = Some(value.clone());
|
||||
|
@ -202,7 +202,7 @@ impl BluetoothRemoteGATTCharacteristicMethods for BluetoothRemoteGATTCharacteris
|
|||
match result {
|
||||
Ok(_) => Ok(()),
|
||||
Err(error) => {
|
||||
Err(Type(error))
|
||||
Err(Error::from(error))
|
||||
},
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue