You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
console.error(err.cause) // 'Error: Failed to acquire lock'
813
+
814
+
if (err.cause&&err.cause.code==='LEVEL_LOCKED') {
815
+
// Another process or instance has opened the database
816
+
}
809
817
}
810
818
```
811
819
@@ -860,6 +868,10 @@ When a value is `null`, `undefined` or (if an implementation deems it so) otherw
860
868
861
869
Data could not be read (from an underlying store) due to a corruption.
862
870
871
+
#### `LEVEL_IO_ERROR`
872
+
873
+
Data could not be read (from an underlying store) due to an input/output error, for example from the filesystem.
874
+
863
875
#### `LEVEL_INVALID_PREFIX`
864
876
865
877
When a sublevel prefix contains characters outside of the supported byte range.
@@ -886,6 +898,22 @@ module.exports = function plugin (db) {
886
898
887
899
When a method, option or other property was used that has been removed from the API.
888
900
901
+
#### `LEVEL_LOCKED`
902
+
903
+
When an attempt was made to open a database that is already open in another process or instance. Used by `classic-level` and other implementations of `abstract-level` that use exclusive locks.
904
+
905
+
#### `LEVEL_READONLY`
906
+
907
+
When an attempt was made to write data to a read-only database. Used by `many-level`.
908
+
909
+
#### `LEVEL_CONNECTION_LOST`
910
+
911
+
When a database relies on a connection to a remote party and that connection has been lost. Used by `many-level`.
912
+
913
+
#### `LEVEL_REMOTE_ERROR`
914
+
915
+
When a remote party encountered an unexpected condition that it can't reflect with a more specific code. Used by `many-level`.
916
+
889
917
### Shared Access
890
918
891
919
Unless documented otherwise, implementations of `abstract-level` do _not_ support accessing a database from multiple processes running in parallel. That includes Node.js clusters and Electron renderer processes.
0 commit comments