marioreggiori / objectdb

Persistent embedded document-oriented NoSQL database for Dart and Flutter.
https://pub.dev/packages/objectdb
MIT License
190 stars 21 forks source link

Invalid Argument in _encodeValue() #65

Closed mikes222 closed 3 years ago

mikes222 commented 3 years ago

Describe the bug

When doing an update the system responds with ArgumentError in _encodeValue() in objectdb_storage_filesystem.dart. Since the structure is big I do not have any hint which type cannot be encoded here. Therefore I ask to give more information in the exception. For example the type of the value.

To Reproduce

Expected behavior An exception stating what type cannot be encoded.

Screenshots

Desktop (please complete the following information):

marioreggiori commented 3 years ago

Only valid json values may be inserted into ObjectDB. Other values can be inserted by encoding them to a valid json value using the SchemaDB constructor. Check out the example

marioreggiori commented 3 years ago

I will look into more detailed exceptions

mikes222 commented 3 years ago

Thx for making the app more verbose. According to #63 I assume that updating with null fails for me too. Not yet tested though but the lib worked like a charm before upgraded to nullSafety and the content of the database had not changed.