handle enum error in read path, refactor tests
format
refactor
format