mirror of https://github.com/arendst/Tasmota.git
Berry `file.write()` raises an exception on failure (ex: disk full) (#21849)
This commit is contained in:
parent
4cf741e6eb
commit
035daa663b
|
@ -18,6 +18,7 @@ All notable changes to this project will be documented in this file.
|
||||||
### Fixed
|
### Fixed
|
||||||
- Berry `light.get` for separate RGB/CT (#21818)
|
- Berry `light.get` for separate RGB/CT (#21818)
|
||||||
- Berry `bytes` setters and getters with negative offsets (#21835)
|
- Berry `bytes` setters and getters with negative offsets (#21835)
|
||||||
|
- Berry `file.write()` raises an exception on failure (ex: disk full)
|
||||||
|
|
||||||
### Removed
|
### Removed
|
||||||
- Berry internal: remove class from closure to simplify code (#21839)
|
- Berry internal: remove class from closure to simplify code (#21839)
|
||||||
|
|
|
@ -26,7 +26,10 @@ static int i_write(bvm *vm)
|
||||||
} else {
|
} else {
|
||||||
data = be_tobytes(vm, 2, &size);
|
data = be_tobytes(vm, 2, &size);
|
||||||
}
|
}
|
||||||
be_fwrite(fh, data, size);
|
size_t bw = be_fwrite(fh, data, size);
|
||||||
|
if (bw != size) {
|
||||||
|
be_raise(vm, "io_error", "write failed");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
be_return_nil(vm);
|
be_return_nil(vm);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue