mirror of
https://git.proxmox.com/git/fwupd
synced 2025-04-29 03:24:33 +00:00
trivial: Use a better error message disambiguate an error message
This commit is contained in:
parent
030a0d51c1
commit
a70d005ea3
@ -488,7 +488,10 @@ fu_cfi_device_chip_select(FuCfiDevice *self, gboolean value, GError **error)
|
||||
g_return_val_if_fail(FU_IS_CFI_DEVICE(self), FALSE);
|
||||
g_return_val_if_fail(error == NULL || *error == NULL, FALSE);
|
||||
if (klass->chip_select == NULL) {
|
||||
g_set_error_literal(error, FWUPD_ERROR, FWUPD_ERROR_NOT_SUPPORTED, "not supported");
|
||||
g_set_error_literal(error,
|
||||
FWUPD_ERROR,
|
||||
FWUPD_ERROR_NOT_SUPPORTED,
|
||||
"chip select is not implemented on this device");
|
||||
return FALSE;
|
||||
}
|
||||
return klass->chip_select(self, value, error);
|
||||
|
@ -16,7 +16,10 @@
|
||||
GPtrArray *
|
||||
fu_common_get_block_devices(GError **error)
|
||||
{
|
||||
g_set_error(error, G_IO_ERROR, G_IO_ERROR_NOT_SUPPORTED, "not supported");
|
||||
g_set_error(error,
|
||||
G_IO_ERROR,
|
||||
G_IO_ERROR_NOT_SUPPORTED,
|
||||
"getting block devices is not supported on Darwin");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
@ -18,7 +18,10 @@
|
||||
GPtrArray *
|
||||
fu_common_get_block_devices(GError **error)
|
||||
{
|
||||
g_set_error(error, G_IO_ERROR, G_IO_ERROR_NOT_SUPPORTED, "not supported");
|
||||
g_set_error(error,
|
||||
G_IO_ERROR,
|
||||
G_IO_ERROR_NOT_SUPPORTED,
|
||||
"getting block devices is not supported on Windows");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
@ -3819,7 +3819,10 @@ fu_device_get_results(FuDevice *self, GError **error)
|
||||
|
||||
/* no plugin-specific method */
|
||||
if (klass->get_results == NULL) {
|
||||
g_set_error_literal(error, FWUPD_ERROR, FWUPD_ERROR_NOT_SUPPORTED, "not supported");
|
||||
g_set_error_literal(error,
|
||||
FWUPD_ERROR,
|
||||
FWUPD_ERROR_NOT_SUPPORTED,
|
||||
"getting results not supported by device");
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
@ -3859,7 +3862,10 @@ fu_device_write_firmware(FuDevice *self,
|
||||
|
||||
/* no plugin-specific method */
|
||||
if (klass->write_firmware == NULL) {
|
||||
g_set_error_literal(error, FWUPD_ERROR, FWUPD_ERROR_NOT_SUPPORTED, "not supported");
|
||||
g_set_error_literal(error,
|
||||
FWUPD_ERROR,
|
||||
FWUPD_ERROR_NOT_SUPPORTED,
|
||||
"writing firmware not supported by device");
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
@ -3994,7 +4000,10 @@ fu_device_read_firmware(FuDevice *self, FuProgress *progress, GError **error)
|
||||
|
||||
/* device does not support reading for verification CRCs */
|
||||
if (!fu_device_has_flag(self, FWUPD_DEVICE_FLAG_CAN_VERIFY_IMAGE)) {
|
||||
g_set_error_literal(error, FWUPD_ERROR, FWUPD_ERROR_NOT_SUPPORTED, "not supported");
|
||||
g_set_error_literal(error,
|
||||
FWUPD_ERROR,
|
||||
FWUPD_ERROR_NOT_SUPPORTED,
|
||||
"reading firmware is not supported by device");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@ -4035,7 +4044,10 @@ fu_device_dump_firmware(FuDevice *self, FuProgress *progress, GError **error)
|
||||
|
||||
/* use the default FuFirmware when only ->dump_firmware is provided */
|
||||
if (klass->dump_firmware == NULL) {
|
||||
g_set_error_literal(error, FWUPD_ERROR, FWUPD_ERROR_NOT_SUPPORTED, "not supported");
|
||||
g_set_error_literal(error,
|
||||
FWUPD_ERROR,
|
||||
FWUPD_ERROR_NOT_SUPPORTED,
|
||||
"dumping firmware is not supported by device");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@ -4756,7 +4768,10 @@ fu_device_bind_driver(FuDevice *self, const gchar *subsystem, const gchar *drive
|
||||
|
||||
/* not implemented */
|
||||
if (klass->bind_driver == NULL) {
|
||||
g_set_error_literal(error, FWUPD_ERROR, FWUPD_ERROR_NOT_SUPPORTED, "not supported");
|
||||
g_set_error_literal(error,
|
||||
FWUPD_ERROR,
|
||||
FWUPD_ERROR_NOT_SUPPORTED,
|
||||
"binding drivers is not supported by device");
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
@ -4789,7 +4804,10 @@ fu_device_unbind_driver(FuDevice *self, GError **error)
|
||||
|
||||
/* not implemented */
|
||||
if (klass->unbind_driver == NULL) {
|
||||
g_set_error_literal(error, FWUPD_ERROR, FWUPD_ERROR_NOT_SUPPORTED, "not supported");
|
||||
g_set_error_literal(error,
|
||||
FWUPD_ERROR,
|
||||
FWUPD_ERROR_NOT_SUPPORTED,
|
||||
"unbinding drivers is not supported by device");
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
@ -1759,7 +1759,10 @@ fu_udev_device_get_sysfs_attr(FuUdevDevice *self, const gchar *attr, GError **er
|
||||
|
||||
return result;
|
||||
#else
|
||||
g_set_error_literal(error, G_IO_ERROR, G_IO_ERROR_FAILED, "not supported");
|
||||
g_set_error_literal(error,
|
||||
G_IO_ERROR,
|
||||
G_IO_ERROR_FAILED,
|
||||
"getting attributes is not supported as no GUdev support");
|
||||
return NULL;
|
||||
#endif
|
||||
}
|
||||
|
@ -155,7 +155,11 @@ fu_vli_pd_parade_device_read_fw_ver(FuVliPdParadeDevice *self, GError **error)
|
||||
if (!fu_vli_pd_parade_device_i2c_read(self, self->page7, 0x02, buf, 0x1, error))
|
||||
return FALSE;
|
||||
if (buf[0] != 0x01 && buf[0] != 0x02) {
|
||||
g_set_error(error, FWUPD_ERROR, FWUPD_ERROR_NOT_SUPPORTED, "not supported");
|
||||
g_set_error(error,
|
||||
FWUPD_ERROR,
|
||||
FWUPD_ERROR_NOT_SUPPORTED,
|
||||
"not supported on this device: buffer was 0x%02x",
|
||||
buf[0]);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user