script: Add message to NotFoundError (#39394)

Adding an optional message to be attached to a NotFoundError.

Testing: Just a refactor
Part of #39053

---------

Signed-off-by: Rodion Borovyk <rodion.borovyk@gmail.com>
This commit is contained in:
Rodion Borovyk 2025-09-25 14:16:50 +02:00 committed by GitHub
parent ffdb7d3663
commit 9713bb9e1b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
18 changed files with 37 additions and 38 deletions

View file

@ -230,7 +230,7 @@ impl Bluetooth {
if let PermissionState::Denied =
descriptor_permission_state(PermissionName::Bluetooth, None)
{
return p.reject_error(Error::NotFound, can_gc);
return p.reject_error(Error::NotFound(None), can_gc);
}
// Note: Step 3, 6 - 8 are implemented in
@ -530,7 +530,7 @@ impl Convert<Error> for BluetoothError {
match self {
BluetoothError::Type(message) => Error::Type(message),
BluetoothError::Network => Error::Network,
BluetoothError::NotFound => Error::NotFound,
BluetoothError::NotFound => Error::NotFound(None),
BluetoothError::NotSupported => Error::NotSupported,
BluetoothError::Security => Error::Security,
BluetoothError::InvalidState => Error::InvalidState,