ayyaruq / zanarkand

Network capture library for realtime FFXIV Frame and FFXIV Message reading from a TCP/IP stream
MIT License
20 stars 8 forks source link

Improved error handling #4

Open ayyaruq opened 4 years ago

ayyaruq commented 4 years ago

We currently just kinda yolo return fmt.Errorf() or the occasional errors.New(). A proper set of error types should be used with wrapping to allow users to appropriately respond to different errors. Packet reassembly errors currently can't even be accessed, so that should be addressed too.

ayyaruq commented 4 years ago

In the reassembler's run() goroutine, using something like Trace and exposing+documenting appropriate debug flags might be a useful addition. Any reassembler errors are currently built, but not logged, due to the goroutine not having any method for output. Having a global error channel is kinda gross, but may be worthwhile.