btrask / stronglink

A searchable, syncable, content-addressable notetaking system
Other
1.04k stars 39 forks source link

Improved error handling #36

Closed btrask closed 8 years ago

btrask commented 9 years ago

Our LevelDB wrapper often just returns -1 instead of a specific error because LevelDB stupidly reports errors as arbitrary strings. I'm not sure what to do there except try to parse them...?

The rest of the code sometimes just uses assertions instead of proper error reporting too.

I'm pretty happy with just using fprintf for logging. We could be a little bit better with our messages though.

btrask commented 9 years ago

Right now we have both UV errors (from libuv) and DB errors (from the database layer, derived from MDB). The first problem is that sometimes we mix them up (they're both plain ints). The second problem is that we can't expect clients of the server API (#39) to understand or care about the difference.

I don't know what the solution is here. Either unifying them or converting them to our own error code type...

This almost certainly has some security repercussions.