We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent fa51c1f commit b571130Copy full SHA for b571130
lib/src/box.dart
@@ -228,14 +228,9 @@ class Box<T> {
228
}
229
230
bool remove(int id) {
231
- try {
232
- checkObx(bindings.obx_box_remove(_cBox, id));
233
- } on ObjectBoxException catch (ex) {
234
- if (ex.msg == "code 404") {
235
- return false;
236
- }
237
- rethrow;
238
+ final err = bindings.obx_box_remove(_cBox, id);
+ if (err == OBXError.OBX_NOT_FOUND) return false;
+ checkObx(err); // throws on other errors
239
return true;
240
241
0 commit comments