jaredwray / flat-cache

A stupidly simple key/value storage using files to persist the data
MIT License
165 stars 30 forks source link

Where are the Error Handlers? #84

Closed eorroe closed 9 months ago

eorroe commented 9 months ago

Hey just started using this library.

I am aware you want to keep it simple so may not implement my suggestion.

But where are the error handlers.

.setKey()
.save()

all return undefined so there is no way to see if the data was saved or not

Would be nice if

I am having trouble debugging my application because of it.

I also searched this repository for "error" so for a module that is downloaded by the millions, I assume there are no errors on the module side and it has to be something in my code.

But still can't debug because of no error handlers.

However my console.logs indicate the functions are being called

jaredwray commented 9 months ago

@eorroe - Thanks for the note and that is correct that we do not return anything. I do believe as we modernize this code base we will look to do a return of at least true or false. Also, with the major version release we are looking at throwing errors if there is an issue.

This will most likely happen later in 2024.